
-----------------------------------
jaymon333
Fri Oct 12, 2007 8:21 pm

Compiolation difficulties of code, cannot understand where I am going wrong...
-----------------------------------
Im just trying to learn C++ and was starting on some very basic code. Here is what I was working on:

#include 

using namespace std;

int main()

{
    cout"Hey you! I am still alive! The World's End!!\n"
    cin.get();   
}






My compiler is giving me a message, apparently I wrote something wrong on line 9 that is "cin.get();"

It gives the message saying 'cout' undeclared (first use this function)


I am also confused as to why it is talking about 'cout' when that is on the eigth line.

Can anyone help. I'm sure you will all laugh because this is real basic script but im trying to teach myself C++, it's interesting.

-----------------------------------
Euphoracle
Fri Oct 12, 2007 8:23 pm

RE:Compiolation difficulties of code, cannot understand where I am going wrong...
-----------------------------------
cout has it's own special way of doing things, and the beginner doesn't usually get it.  You'll need to shift things with cout, even though it doesn't actually shift it.  :\

http://en.wikipedia.org/wiki/Iostream

-----------------------------------
jaymon333
Fri Oct 12, 2007 10:38 pm

RE:Compiolation difficulties of code, cannot understand where I am going wrong...
-----------------------------------
What do you mean by shift it? you mean put the ':\' before the 'cout' in my script? If that is the case, that confuses me more, because the way I wrote it was IDENTICAL to the way it was written in a working script, I just tried to re-write it the same way in my compiler and it wouldn't work, but I could copy n paste the script from the site I was using and it did work.

By the way, does this seem like a good site for a beginner to start learning C++?:

http://www.cprogramming.com/tutorial/lesson1.html

That is also where I got the source code from too.

Thankyou very much for the reply!

-----------------------------------
rdrake
Fri Oct 12, 2007 10:44 pm

Re: Compiolation difficulties of code, cannot understand where I am going wrong...
-----------------------------------
I may be no expert, but I reckon it should be something like this:
#include 

using namespace std;

int main() {
    cout 