主题:各位大虾,这个错误是什么啊?谢谢啊谢谢啊!
Error spawning cl.exe
下面是程序
#include <iostream>
#include <string>
using namespace std;
class epro
{
public:
epro(int p)
{
price=p;
}
void show1()
{
cout<<"price:"<<price<<endl;
}
protected:
int price;
};
class comp:protected epro
{
public:
comp(int p,string q):epro(p)
{
quality=q;
}
void show2()
{
show1();
cout<<"quality:"<<quality<<endl;
}
protected:
string quality;
}
class prod:protected comp
{
public:
prod(int p,string q,string k):comp(p,q)
{
productor=k;
}
void show_all()
{
cout<<"productor:"<<productor<<endl;
show2();
}
protected:
string productor;
}
int main()
{
prod prod1(5000,"good","IBM");
prod1.show_all();
return 0;
}
非常感谢大家!!
下面是程序
#include <iostream>
#include <string>
using namespace std;
class epro
{
public:
epro(int p)
{
price=p;
}
void show1()
{
cout<<"price:"<<price<<endl;
}
protected:
int price;
};
class comp:protected epro
{
public:
comp(int p,string q):epro(p)
{
quality=q;
}
void show2()
{
show1();
cout<<"quality:"<<quality<<endl;
}
protected:
string quality;
}
class prod:protected comp
{
public:
prod(int p,string q,string k):comp(p,q)
{
productor=k;
}
void show_all()
{
cout<<"productor:"<<productor<<endl;
show2();
}
protected:
string productor;
}
int main()
{
prod prod1(5000,"good","IBM");
prod1.show_all();
return 0;
}
非常感谢大家!!