【发布时间】:2018-02-20 02:24:36
【问题描述】:
我刚刚开始使用 C++,我不确定自己在做什么,但到目前为止,我有一些教程中的“hello world”代码。
#include <iostream>
//i only put this first line from users telling me to, it wasn't part of the original post. edited..
int main () {
std::cout << "Hello, World!\n";
return 0;
}
编译器(Xcode for mac)说在代码的cout 部分之前有一个“意外表达式”。我不知道如何解决这个问题。有人可以帮忙吗?
【问题讨论】:
-
你是否包含了 iostream ?
-
你确定你用 C++ 编译而不是 C 模式吗?
-
你#include
了吗? -
是的,我放了#iostream,但它说找不到文件
-
#include
而不是 #iostream
标签: c++