| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 710 人关注过本帖
标题:[求助]刚学VC就出错,请指点.谢谢
取消只看楼主 加入收藏
heidong
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-7-20
收藏
 问题点数:0 回复次数:0 
[求助]刚学VC就出错,请指点.谢谢

#include <iostream>
#include <string>
using namespace std;
int main()
{
string username;
cout<<"What is your name?:";
cin>>username;
cout<<"Hello"<<username<<"!"<<endl;
return 0;
}

-------------------Configuration: hello - Win32 Debug--------------------
Compiling...
hello.cpp
e:\heidong\vc++\hello\hello.cpp(3) : error C2871: 'std' : does not exist or is not a namespace
e:\heidong\vc++\hello\hello.cpp(6) : error C2065: 'string' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(6) : error C2146: syntax error : missing ';' before identifier 'username'
e:\heidong\vc++\hello\hello.cpp(6) : error C2065: 'username' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(7) : error C2065: 'cout' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(7) : error C2297: '<<' : illegal, right operand has type 'char [20]'
e:\heidong\vc++\hello\hello.cpp(8) : error C2065: 'cin' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(8) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
e:\heidong\vc++\hello\hello.cpp(9) : error C2297: '<<' : illegal, right operand has type 'char [6]'
e:\heidong\vc++\hello\hello.cpp(9) : error C2065: 'endl' : undeclared identifier
Error executing cl.exe.

hello.obj - 9 error(s), 1 warning(s)

搜索更多相关主题的帖子: hello cpp username std 
2006-07-20 11:25
快速回复:[求助]刚学VC就出错,请指点.谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014612 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved