<分区>
我就是想问about this tutorial.
我不明白。他们写的代码是这样的:
intmain() {
cout << "Hello World!\n";
return0;
}
现在,我对 c++ 真的很陌生,但肯定应该是:
int main() {
std::cout << "Hello World!\n";
return 0;
}
或者是否有一些我不理解的奇特的 C++ 编写方式?本教程中编写的代码无法为我编译。
标签 c++
<分区>
我就是想问about this tutorial.
我不明白。他们写的代码是这样的:
intmain() {
cout << "Hello World!\n";
return0;
}
现在,我对 c++ 真的很陌生,但肯定应该是:
int main() {
std::cout << "Hello World!\n";
return 0;
}
或者是否有一些我不理解的奇特的 C++ 编写方式?本教程中编写的代码无法为我编译。
最佳答案
你是对的;那个“教程”塞满了格式错误。
很多很多 C++ 教程都是错误的。不要相信互联网上一些随机者的话;使用 a proper, peer-reviewed book .
关于C++教程似乎不对,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37330143/