这段代码是否有错误:
#include <iostream>
using namespace std;
int main()
{
std:cout << "hello" "\n";
}
GCC未检测到错误,但std:cout
似乎不是标准的。
没有错 我可以重写您的代码以使其更清晰:
#include <iostream>
using namespace std;
int main()
{
std:
cout << "hello" "\n";
}
您创建了一个名为的标签std
。cout
使用不合格的,这是好的,因为你有using指令的std
上面。然后,可以像您一样将字符串文字彼此相邻地写入,以连接字符串文字。这是格式完美的代码,显示“ hello”和换行符。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句