[求助]这个输出的结果为什么是这样的,这个-858993460是怎么回事啊?????
#include<iostream.h>class MyClass
{
private:
int m_Number;
public:
MyClass();
MyClass(int);
~MyClass();
void Display();
};
MyClass::MyClass()
{
cout<<"Constructing normally\n";
}
MyClass::MyClass(int m)
{
m_Number=m;
cout<<"Constructing with a number:"<<m_Number<<endl;
}
void MyClass::Display()
{
cout<<"Display a number:"<<m_Number<<endl;
}
MyClass::~MyClass()
{
cout<<"Destructing\n";
}
void main()
{
MyClass Ob1;
MyClass Ob2(20);
Ob1.Display();
Ob2.Display();
}
这个输出的结果:
Constructing normally
Constructing with a number:20
Display a number:-858993460
Display a number:20
Destructing
Destructing
其中的Display a number:-858993460是怎么来的.........不懂,请指教,谢谢大家
[此贴子已经被作者于2005-10-27 10:36:38编辑过]