| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:[求助]程序错误提示不懂
取消只看楼主 加入收藏
taijixing
Rank: 1
等 级:新手上路
威 望:1
帖 子:118
专家分:0
注 册:2007-6-9
收藏
 问题点数:0 回复次数:1 
[求助]程序错误提示不懂

#include <iostream>
static int n=0;
class CType
{
public:
CType()
{
m_n=n++;
int m_n;
}
};

CType d;
void fs()
{
static CType s;
cout<<"s."<<s.m_n<<endl;
}

void fa()
{
CType a;
cout<<"a."<<a.m_n<<endl;
}

void main()
{
fs();
fs();
fa();
fa();
}


--------------------Configuration: diaoyong2 - Win32 Debug--------------------
Compiling...
diaoyong2.cpp
e:\vc++\add\diaoyong2\diaoyong2.cpp(8) : error C2065: 'm_n' : undeclared identifier
e:\vc++\add\diaoyong2\diaoyong2.cpp(17) : error C2065: 'cout' : undeclared identifier
e:\vc++\add\diaoyong2\diaoyong2.cpp(17) : error C2297: '<<' : illegal, right operand has type 'char [3]'
e:\vc++\add\diaoyong2\diaoyong2.cpp(17) : error C2039: 'm_n' : is not a member of 'CType'
e:\vc++\add\diaoyong2\diaoyong2.cpp(4) : see declaration of 'CType'
e:\vc++\add\diaoyong2\diaoyong2.cpp(17) : error C2065: 'endl' : undeclared identifier
e:\vc++\add\diaoyong2\diaoyong2.cpp(23) : error C2297: '<<' : illegal, right operand has type 'char [3]'
e:\vc++\add\diaoyong2\diaoyong2.cpp(23) : error C2039: 'm_n' : is not a member of 'CType'
e:\vc++\add\diaoyong2\diaoyong2.cpp(4) : see declaration of 'CType'
执行 cl.exe 时出错.

diaoyong2.exe - 1 error(s), 0 warning(s)

搜索更多相关主题的帖子: 程序错误 提示 
2007-07-26 23:36
taijixing
Rank: 1
等 级:新手上路
威 望:1
帖 子:118
专家分:0
注 册:2007-6-9
收藏
得分:0 
多谢楼上大哥
2007-07-27 13:05
快速回复:[求助]程序错误提示不懂
数据加载中...
 
   



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

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