请指点,关于system("PAUSE")使程序不能完整运行的问题。
#include<iostream.h>#include<stdlib.h>
class father
{
public:
father(int h){tall=h;cout<<"tall="<<h<<"\n"<<"he can eat "<<endl;}
protected:
int tall;
};
class son:public father
{
public:
son(int h,int j):father(h){weight=j;cout<<"体重:"<<weight<<"he can eat \n";}
private:
int weight;
};
int main()
{
int e,d;
cout<<"请输身高和体重,结束回车";
cin>>e>>d;
son Mike(e,d);
system("PAUSE");//为什么去掉这一行程序才能完整运行
return 0;
}
为什么去掉system("PAUSE");这一行程序才能完整运行?在别的程序中用总是在运行完才出现“请按任意键继续……”