各位大神 求救,下面的一个c++,我照着书上的给录入的VC++6.0上 ,但就是提示我一个错误。

2025-02-25 15:21:20
推荐回答(4个)
回答1:

你的代码没有问题,估计是编译器问题,或者你创建工程、文件的时候不正确。

回答2:

文件扩展名应该 是.CPP, 不能是.C。

#include
using namespace std;

void main(void)
{
cout << "Hello!\n";
cout << "Welcome to c++!" << endl;
cout << "This is my first c++ program" << endl;
}

回答3:

你好
在我电脑上运行的结果没错误
估计是你新建工作空间和源文件出了问题?是不是选点错了

回答4:

#include
using namespace std;