首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

这个代码对了吗,为什么编译通不过,解决办法

2012-03-11 
这个代码对了吗,为什么编译通不过,这是提示原因:fatal error C1004: unexpected end of file found执行 cl

这个代码对了吗,为什么编译通不过,
这是提示原因:
fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.


#include<iostream>
#include<string>
using namespace std;
struct Person
{
Person(){
cout<<"hahhaha"<<endl;
}
~Person(){
cout<<"wuwuwuwuwu"<<endl;
}
void Introduction(){
if(name=="志玲"){
cout<<"大家好,我是志玲请多多关照"<<endl;
}
else {
cout<<"hello,my name is "<<name<<endl;
}
std::string name;
};
int main()
{
Person xiaoA;
xiaoA.name="xiaoA";
xiaoA.Introduction();

Person*xiaoB=new Person;
xiaoB->name="志玲";
xiaoB->Introduction();
delete xiaoB;

return 0;
}


[解决办法]
提示什么错误?
[解决办法]
intro函数少了一个花括号
[解决办法]
未知的文件尾,建议把代码对齐看,代码应该没问题

热点排行