Hey people,
I am looking to learn C++, I have no prior knowledge of any other language. I've tried using the 'Learn C++ in 21 Days' book which is on the internet but it does not really explain anything. I have made the 'Hello World' program but I cannot compile it because I always get errors.
Here is the code I use:
CODE
#include <iostream>
int main();
int main()
{
cout << "Hello World!\n";
return 0;
}
The guide doesn't specify any particular software or compiler it just says I need a raw text editor (notepad) and some sort of compiler. I downloaded 'Cygwin' and use it to compile but I always get the following messages:
hello.cpp: In function 'int main()':
hello.cpp:6: error: 'cout' undeclared (first use of this function)
hello.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
The code I used is copy and pasted straight from the guide but it still doesn't work. If anyone could explain what is going wrong I would really appreciate it. I am more annoyed at the fact that following the guide word for word doesn't work and I would be even more happy if someone could point me in the right direction or show me a working guide which can help me get started on learning this code.