返回列表 发帖

书中第一章的问题

我按书中的把Stdafx.h修改了,把以下代码写好
// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
    cout<<"HELLO WORLD"<<endl;
        return 0;
}
可最后结果为

Compiling...
test.cpp
H:\VC++\MSDev98\MyProjects\test\test.cpp(8) : error C2065: 'cout' : undeclared identifier
H:\VC++\MSDev98\MyProjects\test\test.cpp(8) : error C2297: '<<' : illegal, right operand has type 'char [12]'
H:\VC++\MSDev98\MyProjects\test\test.cpp(8) : error C2065: 'endl' : undeclared identifier
Error executing cl.exe.

test.obj - 3 error(s), 0 warning(s)
请赐教啊
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

你好。你注意看一下书中第12页中对stdafx.h中的修改。

TOP

返回列表