Computer Science Canada Help! |
Author: | nemisis652 [ Thu Apr 30, 2009 6:11 pm ] | ||||
Post subject: | Help! | ||||
Hey, im very new to C++ and have taken measures to aquire a copy of "C++ for Dummies" which comes with a CD-ROM with a copy of Dev-C++ and some source code in the book, however i dont have that CD so i am forced to write the code in the book out by hand and into my downloaded Beta Copy of Dev-C++ (version 5 i believe) well my problem is i am running into errors when compiling the code I'm inputting into the Dev and i am not sure what the problem is, because i am inputting the code exactly as is. So my two thoughts are: 1) im missing something that the CDROM has that the book isnt showing 2) The Dev im running is bugged The errors im getting are with the cout and cin statements and its telling me that they are undeclared. this is my code:
im sorry in advance if im posting my question wrong, or posting my code wrong. Not only am i new at C++ but im new at Compsci. Any help would be greatly appreciated as i need to learn this as fast as possible! Thanks! ![]() Mod Edit: Remember to use syntax tags! Thanks ![]()
|
Author: | Insectoid [ Thu Apr 30, 2009 6:23 pm ] |
Post subject: | RE:Help! |
Loving that thread title, nemesis. Very descriptive. |
Author: | nemisis652 [ Thu Apr 30, 2009 6:26 pm ] |
Post subject: | RE:Help! |
lol i just thought it would catch some attention, i suppose it worked. ![]() Sorry though! theres always next time. |
Author: | Insectoid [ Thu Apr 30, 2009 6:49 pm ] |
Post subject: | RE:Help! |
It didn't work. There are hundreds of posts with this or similar names every year. Be creative, and think a bit. Am I the first to post something about help? Anywho, it looks like you're putting effort into this and while I can't help you (don't know the first thing about C++), I'm sure somebody will. |
Author: | zero-impact [ Thu Apr 30, 2009 6:51 pm ] | ||||
Post subject: | RE:Help! | ||||
The problem is you need to do it like this
otherwise add
Just after your #includes. |
Author: | nemisis652 [ Thu Apr 30, 2009 7:13 pm ] |
Post subject: | RE:Help! |
okay thank you so much, it cleared up my problems but im having one more and its come up a few times in other programs, maybe you guys can help me out. in the book its telling me to use a function 'end1', while the book says that it creates a new-line, my version of Dev-C++ says its undeclared. As i previously said im extremely new so im just guessing, but would it work to declare end1 a '/n' to make it a new line, or does that only work in strings? p.s. insectoid, your right about the hastiness about my post, but im really putting my all into it and i guess i didnt lurk the forum enough to really get a handle on how things work around here. Not only am i learning C++ but im learning the nuances of this forum and i look forward to being a (hopefully) skilled contributing member to this community. |
Author: | saltpro15 [ Thu Apr 30, 2009 7:18 pm ] | ||
Post subject: | RE:Help! | ||
way to kiss ass ![]()
|
Author: | zero-impact [ Thu Apr 30, 2009 7:19 pm ] |
Post subject: | RE:Help! |
That "1" you are seeing is actually an "l" (lowercase L). So it would be: [code]std::endl[\code] Notice the use of "std::" again. |
Author: | nemisis652 [ Thu Apr 30, 2009 7:20 pm ] |
Post subject: | RE:Help! |
shit, i have literally been doing that this whole time :O haha thanks! |