主题:关于毕业生表的问题!
哪位高手帮忙解决一下,问题1>对要从文本读入数据,请问文本文件放在什么地方,在工程的同一个文件夹里的吗,问题2>对于一个工程里面有sourcefile.resourcefile里面该放哪些文件,问题3>我写的是关于一个毕业生表的问题,先从教务文件中读取取得学位资格的学生,然后再从校长文件中读取不参加毕业典礼的学生,最后输出根据文理学位不同排列输出参加毕业典礼的学生.带码如下:class graduate
{
public:
graduate();
string getDegree()const;
friend bool operator==(const graduate&chs,const graduate&rhs);
friend bool operator<(const graduate&chs,const graduate&rhs);
friend istream&operator>>(istream&istr,graduate&grad);
friend ostream&operator<<(ostream&ostr,const graduate&grad);
private:
string name;
string degree;
};
void removeGraduate (list<graduate>&gradlist,const graduate&grad);
{
list<graduate>::iterator iter=seqsearch<graduate>(gradlist.begin,gradlist.end,grad)
if(iter!=gradlist.end())
gradlist.erase(iter);
}
#include<iostrem>
#include<fstream>
#include<cstdlib>
#include<string>
#include<list>
#include"d_util.h"
#include"d_grad.h"
#include"d_listl.h"
#include'd_search.h"
void removeGraduate(list<graduate>&gradlist,const graduate&grad);
int main()
{
graduate grad;
list<graduate>gradBA_list,gradBS_list,diplomalist;
ifstream gradIn,noAttIn;
gradIn.open("gradlist.dat");
if(!gradIn)
{
cerr<<"cannot open file"<<endl;
exit(1);
}
while(true)
{
gradIn>>grad;
if(!gradIn)
break;
if(grad.getDegree()=="BS")
insertOrder(gradBS_list,grad)
else
insertOrder(gradBA_list,grad);
}
gradIn.close();
noAttIn.open("noattend.dat");
if(!noAttIn)
{
cerr<<"cannot open file"<<endl;
exit(1);
}
while(true)
{
noAttIn>>grad;
if(!noAttIn)
break;
if(grad.getDegree()=="BS")
removeGraduate(gradBS_list,grad);
else
removeGraduate(gradBA_lsit,grad);
}
diplomalist=gradBS_list;
splice<graduate>(diplomalist,diplomalist.end(),gradBA.list);
cout<<"students at Gradation"<<endl<<enld;
writelist(diplomalist,"\n");
return 0;
}
{
public:
graduate();
string getDegree()const;
friend bool operator==(const graduate&chs,const graduate&rhs);
friend bool operator<(const graduate&chs,const graduate&rhs);
friend istream&operator>>(istream&istr,graduate&grad);
friend ostream&operator<<(ostream&ostr,const graduate&grad);
private:
string name;
string degree;
};
void removeGraduate (list<graduate>&gradlist,const graduate&grad);
{
list<graduate>::iterator iter=seqsearch<graduate>(gradlist.begin,gradlist.end,grad)
if(iter!=gradlist.end())
gradlist.erase(iter);
}
#include<iostrem>
#include<fstream>
#include<cstdlib>
#include<string>
#include<list>
#include"d_util.h"
#include"d_grad.h"
#include"d_listl.h"
#include'd_search.h"
void removeGraduate(list<graduate>&gradlist,const graduate&grad);
int main()
{
graduate grad;
list<graduate>gradBA_list,gradBS_list,diplomalist;
ifstream gradIn,noAttIn;
gradIn.open("gradlist.dat");
if(!gradIn)
{
cerr<<"cannot open file"<<endl;
exit(1);
}
while(true)
{
gradIn>>grad;
if(!gradIn)
break;
if(grad.getDegree()=="BS")
insertOrder(gradBS_list,grad)
else
insertOrder(gradBA_list,grad);
}
gradIn.close();
noAttIn.open("noattend.dat");
if(!noAttIn)
{
cerr<<"cannot open file"<<endl;
exit(1);
}
while(true)
{
noAttIn>>grad;
if(!noAttIn)
break;
if(grad.getDegree()=="BS")
removeGraduate(gradBS_list,grad);
else
removeGraduate(gradBA_lsit,grad);
}
diplomalist=gradBS_list;
splice<graduate>(diplomalist,diplomalist.end(),gradBA.list);
cout<<"students at Gradation"<<endl<<enld;
writelist(diplomalist,"\n");
return 0;
}