qq_43919400
threecat.up
2019-03-19 22:27

程序在VC运行不了,请求大佬帮帮我看看运行结果是什么?谢谢啦(C++代码)

  • c++

#include
class MyClass
{
public:
MyClass();
MyClass(int);
~MyClass();
void Display();
protected:
int number;
};
MyClass::MyClass()
{
cout<<"Constructing normally\n";
}
MyClass::MyClass(int m)
{
number = m;
cout<<"Construsting with a number:"<<number<<endl;
}
void MyClass::Display()
{
cout<<"Display a number:"<<number<<endl;
}
MyCall::~MyClass()
{
cout<<"Destructing\n";
}
void main()
{
MyClass obj1;
MyClass obj2(20);

obj1.Display();
obj2.Display();

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答