Console math problem!
Dude, I think I have the same book as you because I got the idea from that book. Only, that it says cout >> instead of printf and all this weird language mixed into C++
What you're programming is C. That boook was about C++ (since it was using cout), so that's probably why it confused you.
[edited by - micepick on April 1, 2003 3:04:06 PM]
[edited by - micepick on April 1, 2003 3:04:06 PM]
What''s wrong with C?
To be honest, it doesn''t seem like you''ve learned it all that well anyway. You should go over the basics so that you don''t have so many errors in your programs.
To be honest, it doesn''t seem like you''ve learned it all that well anyway. You should go over the basics so that you don''t have so many errors in your programs.
I wish I started w/ C. I try to read MUD code and it''s like "what the hell is that?!" . Oh well I''m still pretty happy. If I could get this stupid game to work properly...
printf/scanf etc. is C, while cout/cin is C++. However, C code will compile with a C++ compiler. cout and cin are easier though, in my opinion, being about you''re age. The main difference between C and C++ is that C++ has classes and such.
-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
I started with C++ and VB 6 years ago, but I tend to use a lot of C-style code since learning it a year ago. Learn them both since so much of it is interchangeable.
(silencer)
(silencer)
Lol I don''t think C++ is for me. When micepick pointed out I was using C the WHOLE time which is 3 months I tried a little C++ on my Dev-C++ compiler but it said cout is unsigned and I''m like ''WHAT THE HELL!?'' I''ll start another topic on that right now. Lol, I wouldn''t mind if you guys helped me on that too.
Unsigned means it can''t be negative (ie the - sign), but if you mean undefined, try including iostream and adding the line
using std::cout.
-~-The Cow of Darkness-~-
using std::cout.
-~-The Cow of Darkness-~-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement