occupy_quantity=;
wait_quantity=;
}
//读数据文件
int readData()
{
FILE *fp;
char fname[];
int i;
cout<<请输入资源分配表文件的文件名:< strcpy(fname,"10trouble1.txt");
//cin>>fname;
if((fp=fopen(fname,"r"))==NULL){
cout<<"错误,文件打不开,请检查文件名:)"< return 0;
}
else{
while(!feof(fp)){
fscanf(fp,"%d %d",&occupy[occupy_quantity].resource,&occupy[occupy_quantity].process);
occupy_quantity++;
}
}
cout<<"请输入进程等待表文件的文件名:"< strcpy(fname,"10trouble2.txt");
//cin>>fname;
if((fp=fopen(fname,"r"))==NULL){
cout<<"错误,文件打不开,请检查文件名:)"< return 0;
[1] [2] [3] [4] [5]