执行 cl.exe 时出错!C++高手帮我看看那里出错呀,帮忙改过来!谢谢
#include<iostream.h>
#include<stdlib.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
class employee
{
public:
employee()
{
salary=0;
}
void pay(){}
void print(){}
void input()
{
cout<<"ID:";
cin>>no;
cout<<" NAME:";
cin>>name;
cout<<" SEX(m/w):";
cin>>sex;
cout<<" AGE:";
cin>>age;
}
protected:
int no;
char name[8];
float salary;
char sex;
int age;
};
class manager:virtual public employee
{
protected:
float monthlypay,sale;
public:
manager(){monthlypay=8000;}
void input(){cout<<"Manger";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"Manger"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay(){salary=monthlypay;}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class technician:virtual public employee
{
private:
float hourlyrate;
int workhours;
public:
technician(){hourlyrate=100;}
void pay()
{
cout<<name<<"Work hour:";
cin>>workhours;
salary=hourlyrate*workhours;
}
void input(){cout<<"TECHNICIAN"<<endl;employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class salesman:virtual public employee
{
protected:
float commrate;
float sales;
public:
salesman(){commrate=0.04;}
void input(){cout<<"SALEMAN";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay()
{
cout<<name<<"Sales volume:";
cin>>sales;
salary=sales*commrate;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)\
<<sex<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
#include<stdlib.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
class employee
{
public:
employee()
{
salary=0;
}
void pay(){}
void print(){}
void input()
{
cout<<"ID:";
cin>>no;
cout<<" NAME:";
cin>>name;
cout<<" SEX(m/w):";
cin>>sex;
cout<<" AGE:";
cin>>age;
}
protected:
int no;
char name[8];
float salary;
char sex;
int age;
};
class manager:virtual public employee
{
protected:
float monthlypay,sale;
public:
manager(){monthlypay=8000;}
void input(){cout<<"Manger";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"Manger"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay(){salary=monthlypay;}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class technician:virtual public employee
{
private:
float hourlyrate;
int workhours;
public:
technician(){hourlyrate=100;}
void pay()
{
cout<<name<<"Work hour:";
cin>>workhours;
salary=hourlyrate*workhours;
}
void input(){cout<<"TECHNICIAN"<<endl;employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class salesman:virtual public employee
{
protected:
float commrate;
float sales;
public:
salesman(){commrate=0.04;}
void input(){cout<<"SALEMAN";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay()
{
cout<<name<<"Sales volume:";
cin>>sales;
salary=sales*commrate;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)\
<<sex<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
...全文
相关推荐
Python找不到cl.exe等
当我们尝试使用Cython构建Python扩展库时,可能会遇到找不到cl.exe的问题。cl.exe是MSVC的命令行编译器。如果出现这样的错误,意味着系统无法找到MSVC的编译器。
cl.exe文件缺失时下载
出现cl.exe文件缺失时下载,然后pip运行即可。
关于c++中这个错误的解决方法Error spawning cl.exe
### 关于C++中“Error Spawning cl.exe”的解决方法在C++开发过程中,遇到“Error Spawning cl.exe”这一问题时,不少开发者可能会感到困惑。
vc6.0中出现Error_spawning_cl.exe_错误的解决办法
### vc6.0中出现Error_spawning_cl.exe_错误的解决办法在使用Visual C++ 6.0(以下简称VC6.0)的过程中,部分用户可能会遇到“Error_spawning_cl.exe
Compiling... ,Error spawning cl.exe错误
- 当Visual C++ 6.0在编译过程中无法找到CL.exe时,就会报出“Compiling..., Error spawning cl.exe”的错误。**2.


