我从这里下载了 Code::Blocks:http: //www.codeblocks.org/downloads/26
我正在学习c编程。当我运行以下程序时,出现错误:
iostream: No such file or directory
error: syntax error before "namespace"
warning: type defaults to `int' in declaration of `std'
warning: data definition has no type or storage class
In function `main':
error: `cout' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
error: `cin' undeclared (first use in this function)
我正在运行以下程序:
#include <iostream>
using namespace std;
int main()
{
int x;
x = 0;
do {
// "Hello, world!" is printed at least one time
// even though the condition is false
cout<<"Hello, world!\n";
} while ( x != 0 );
cin.get();
}
我尝试了 Dev-C++,我得到了同样的错误。如何解决这个问题?