我是新的C++和我在「Hello World」程序,我不斷收到錯誤COUT沒有指定類型
「COUT」不點名,我使用geany類型Ubuntu的,如果有差別,這裏是我的代碼:
#include <iostream>
int main()
{
extern cout << "hello world!";
return 0;
}
我不想做一個新的問題,所以我要在這裏添加它
隨着修訂供貨現在它將編譯,但是當我運行程序,我得到錯誤
./geany_run_script.sh: 5: ./geany_run_script.sh: ./hello: not found
對此有何看法?
你可能需要'std :: cout',或'#include'後面的'using namespace std;'。 – 2013-03-16 23:53:00
我認爲你需要在main()或'std :: cout'之前指定命名空間'std':'使用命名空間標準'' – A4L 2013-03-16 23:53:12
請不要使用(或建議)'使用命名空間標準;'我們都知道這個爛攤子它最終造成。 :(只需在需要的地方使用'std ::'前綴 – syam 2013-03-16 23:58:52