c++ 标准库里没有 .h 结尾的头文件。而且所有函数均在 std 这个名空间里。
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}o
如果有书讲你可以用 .h 的头文件,应该是很老的书了。
虽然这种代码现在也能使,但不推荐这种写法。请参考下面的程序:
程序代码:#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}o