| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 598 人关注过本帖
标题:到底哪里出错了
取消只看楼主 加入收藏
lihaisheng
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-12-19
收藏
 问题点数:0 回复次数:0 
到底哪里出错了
谁帮我看看啊,单独运行没错,可和着几个功能运行时就说致命错误C1076:汇编者极限:内部堆极限达到;使用/Zm指定一更高极限,Why?
//删除
int Delete()
{
TeachersalaryPtr bogush,feigned;
TeachersalaryPtr p,q,before,discard;
ifstream in_stream;
ofstream out_stream;
bogush=NULL;
in_stream.open("LP.txt");
if(in_stream.fail())
{
cout<<"\t\tLP文件现无任何记录.\n";
cout<<"\t\t请先输入数据信息.\n";
return 0;
}
int no,number;
char ans;
string trs;
while(!in_stream.eof())
{
before=new Teachersalary;
//before->next=NULL;
in_stream>>before->department>>before->teacherNO>>before->name>>before->base_salary
>>before->post_salary>>before->bonus>>before->deal_salary
>>before->found>>before->tax>>before->fact_salary;
before->next=NULL;
if(bogush==NULL)
feigned=bogush=before;
else
q->next=before;
q=before;
}
//q->next=NULL;
in_stream.close();
out_stream.open("LP.txt");
if(out_stream.fail())
{
cout<<"\t\t无法打开LP文件.\n";
return 0;
}
discard=bogush;
cout<<"\t\t*********************************************\n"
<<"\t\t* 1.按姓名 2.按教师号 *\n"
<<"\t\t*********************************************\n"
<<"\t\t请输入要删除的方式:";
cin>>no;
if(no==1)
{
cout<<"\t\t请输入要删除的姓名:";
cin>>trs;
while(discard->name!=trs&&discard->next!=NULL)
{
before=discard; //before指向当前节点
discard=discard->next; //discard指向下一个节点
}
if(discard->name==trs) //找到了
{
cout<<"其中A=系别/部门, B=教师号, C=姓名, D=基本工资, E=岗位工资\n"
<<" F=奖金, G=应发工资, H=医疗住房基金, I=税金, J=实发工资\n";
cout<<setw(3)<<"A"<<setw(8)<<"B"<<setw(8)<<"C"<<setw(7)<<"D"<<setw(6)<<"E"
<<setw(6)<<"F"<<setw(6)<<"G"<<setw(6)<<"H"<<setw(6)<<"I"
<<setw(6)<<"J"<<endl;
cout<<discard->department<<setw(7)<<discard->teacherNO<<setw(8)<<discard->name<<setw(6)<<discard->base_salary
<<setw(6)<<discard->post_salary<<setw(6)<<discard->bonus<<setw(6)<<discard->deal_salary
<<setw(6)<<discard->found<<setw(6)<<discard->tax<<setw(6)<<discard->fact_salary<<endl;
if(discard->name==bogush->name) //如找到的节点是头节点
bogush=discard->next; //否则使before所指节点的指针指向下一个节点
else //如找到的节点不是第一个节点
before->next=discard->next; //否则使before所指节点的指针指向下一个节点
do{
cout<<"\t\t是否要删除此教师记录?(Y/N):";
cin>>ans;
if(ans=='y'||ans=='Y')
{
delete discard;
cout<<"\t\t删除成功!\n";
cout<<"\t\t此教师号已被删除!\n";
q=bogush;
while(q!=NULL)
{
out_stream<<q->department;
out_stream<<setw(7)<<q->teacherNO;
out_stream<<setw(8)<<q->name;
out_stream<<setw(6)<<q->base_salary;
out_stream<<setw(6)<<q->post_salary;
out_stream<<setw(6)<<q->bonus;
out_stream<<setw(6)<<q->deal_salary;
out_stream<<setw(6)<<q->found;
out_stream<<setw(6)<<q->tax;
out_stream<<setw(6)<<q->fact_salary<<endl;
q=q->next;
}
q=bogush;
while(q!=NULL)
{
p=q; //指针p记录待销毁节点
q=q->next;
delete p;
}
}
else if(ans=='n'||ans=='N')
{
q=feigned;
while(q!=NULL)
{
out_stream<<q->department;
out_stream<<setw(7)<<q->teacherNO;
out_stream<<setw(8)<<q->name;
out_stream<<setw(6)<<q->base_salary;
out_stream<<setw(6)<<q->post_salary;
out_stream<<setw(6)<<q->bonus;
out_stream<<setw(6)<<q->deal_salary;
out_stream<<setw(6)<<q->found;
out_stream<<setw(6)<<q->tax;
out_stream<<setw(6)<<q->fact_salary<<endl;
q=q->next;
}
q=feigned;
while(q!=NULL)
{
p=q; //指针p记录待销毁节点
q=q->next;
delete p;
}
}
else
cout<<"\t\t无效操作.\n";
new_line();
}while((ans!='y')&&(ans!='Y')&&(ans!='n')&&(ans!='N'));
}
else
{
cout<<"\t\t查无此教师记录!\n";
return 0;
}
}
else if(no==2)
{
cout<<"\t\t请输入要删除的教师号:";
cin>>number;
while(discard->teacherNO!=number&&discard->next!=NULL)
{
before=discard; //before指向当前节点
discard=discard->next; //discard指向下一个节点
}
if(discard->name==trs) //找到了
{
cout<<"其中A=系别/部门, B=教师号, C=姓名, D=基本工资, E=岗位工资\n"
<<" F=奖金, G=应发工资, H=医疗住房基金, I=税金, J=实发工资\n";
cout<<setw(3)<<"A"<<setw(8)<<"B"<<setw(8)<<"C"<<setw(7)<<"D"<<setw(6)<<"E"
<<setw(6)<<"F"<<setw(6)<<"G"<<setw(6)<<"H"<<setw(6)<<"I"
<<setw(6)<<"J"<<endl;
cout<<discard->department<<setw(7)<<discard->teacherNO<<setw(8)<<discard->name<<setw(6)<<discard->base_salary
<<setw(6)<<discard->post_salary<<setw(6)<<discard->bonus<<setw(6)<<discard->deal_salary
<<setw(6)<<discard->found<<setw(6)<<discard->tax<<setw(6)<<discard->fact_salary<<endl;
if(discard->teacherNO==bogush->teacherNO) //如找到的节点是头节点
bogush=discard->next; //否则使before所指节点的指针指向下一个节点
else //如找到的节点不是第一个节点
before->next=discard->next; //否则使before所指节点的指针指向下一个节点
do{
cout<<"\t\t是否要删除此教师记录?(Y/N):";
cin>>ans;
if(ans=='y'||ans=='Y')
{
delete discard;
cout<<"\t\t删除成功!\n";
cout<<"\t\t此教师号已被删除!\n";
q=bogush;
while(q!=NULL)
{
out_stream<<q->department;
out_stream<<setw(7)<<q->teacherNO;
out_stream<<setw(8)<<q->name;
out_stream<<setw(6)<<q->base_salary;
out_stream<<setw(6)<<q->post_salary;
out_stream<<setw(6)<<q->bonus;
out_stream<<setw(6)<<q->deal_salary;
out_stream<<setw(6)<<q->found;
out_stream<<setw(6)<<q->tax;
out_stream<<setw(6)<<q->fact_salary<<endl;
q=q->next;
}
q=bogush;
while(q!=NULL)
{
p=q; //指针p记录待销毁节点
q=q->next;
delete p;
}
}
else if(ans=='n'||ans=='N')
{
q=feigned;
while(q!=NULL)
{
out_stream<<q->department;
out_stream<<setw(7)<<q->teacherNO;
out_stream<<setw(8)<<q->name;
out_stream<<setw(6)<<q->base_salary;
out_stream<<setw(6)<<q->post_salary;
out_stream<<setw(6)<<q->bonus;
out_stream<<setw(6)<<q->deal_salary;
out_stream<<setw(6)<<q->found;
out_stream<<setw(6)<<q->tax;
out_stream<<setw(6)<<q->fact_salary<<endl;
q=q->next;
}
q=feigned;
while(q!=NULL)
{
p=q; //指针p记录待销毁节点
q=q->next;
delete p;
}
}
else
cout<<"\t\t无效操作.\n";
new_line();
}while((ans!='y')&&(ans!='Y')&&(ans!='n')&&(ans!='N'));
}
else
{
cout<<"\t\t查无此教师记录!\n";
return 0;
}
}
else
cout<<"\t\t无效操作.\n";
out_stream.close();
return (1);
}
搜索更多相关主题的帖子: number return before 极限 记录 
2006-12-19 17:36
快速回复:到底哪里出错了
数据加载中...
 
   



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

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