I just bought a book on C++, as i am very new to this, only my second day, this might seem incredibly dumb to ask, but ive searched online for the answer and cannot figure it out. I get an error message,
fatal error: iostream: No such file or directory
compilation terminated.
This to be exact, and i cannot figure out how to stop it.
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
usingnamespace std;
int main()
{
int mynumber;
mynumber = 10;
cout << my number << endl;
return 0;
}
Heres the code, exactly how it was in the book, but it doesnt work, if someone could help me out, that would be great, thanks!
David joh, I just tried it on my computer, which has code::blocks with the MinGW compiler, and it worked properly (after adding cin.get (); to stop the screen from disappearing.)
Perhaps you have the wrong compiler? Cheers, Don
PS. The above files are free downloads and work beautifully.
#include <iostream>
using namespace std;
int main()
{
int mynumber;
mynumber = 10;
cout << mynumber << endl;
cin.get(); //To stop screen flashing off
return 0;
}