: These are the exact errors, copy and pasted.
:
: 21 C:\My Documents\first.cpp:1
: iostream.h: No such file or directory.
:
: 2 C:\My Documents\first.cpp
: `cout' not declared
:
: 4 C:\My Documents\first.cpp
: `main' must return `int'
:
: C:\My Documents\first.cpp
: [Warning] In function `int main(...)':
:
: 5 C:\My Documents\first.cpp
: `cout' undeclared (first use this function)
:
:
: [Build Error] (Each undeclared identifier is reported only once
:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your problems are as follows:
1. Your compiler cannot find iostream.h
You need to modify your compiler settings for include files to look in the directory where this file is stored, or better still use std::iostream (i.e without the h)
2. std::cout is defined in <iostream>, not <iostream.h>
3. Your compiler is enforcing the more modern style of main function which returns an int rather than void. Just put "return 0" at the end of your main function and you'll be OK. It should look something like
int main()
{
//code here
return 0;
}
4. cout as "undeclared" goes back to point 1
The basic problem is that you are trying to include old style header, but use new style std function calls. I'm not sure who told you to do that, but it's just plain wrong.
Hope this helps