Fatal error for iostream | Sololearn: Learn to code for FREE!


Fatal error for iostream

I am attempting to learn c++ using the Code::Blocks application suggested for this course. The simple "Hello world" code below came built into the program and works fine. #include <iostream> using namespace std; int main() { cout << "Hello world!" << endl; return 0; } However, if I copy the same code into a different file and try to run it again, it says "fatal error: iostream: no such file or directory" Is there something I need to download or add to the application or code to make this work?

10/4/2019 3:27:28 PM


1 Answer

New Answer


What is the extension you gave to the new file you copied the code to? Also check that any new file created is not treated as C file by default? If the sample code is working fine, then you are making some mistake somewhere.