class A
{
public:A(int i=0):r1(i){}
void print(){cout<<'E'<<r1<<'-';}
void print()const{cout<<'C'<<r1*r1<<'-';}
void print(int x){cout<<'P'<<r1*r1*r1<<'-';}
private:
int r1;
};
int _tmain(int argc, _TCHAR* argv[])
{
A a1;
const A a2(4);
a1.print(2);
a2.print();
return 0;
system("PAUSE");
return 0;
}
用VS2008 和C++builder 6.0 编译都没有提示出错,但是DOS窗口就一闪而过~求解
{
public:A(int i=0):r1(i){}
void print(){cout<<'E'<<r1<<'-';}
void print()const{cout<<'C'<<r1*r1<<'-';}
void print(int x){cout<<'P'<<r1*r1*r1<<'-';}
private:
int r1;
};
int _tmain(int argc, _TCHAR* argv[])
{
A a1;
const A a2(4);
a1.print(2);
a2.print();
return 0;
system("PAUSE");
return 0;
}
用VS2008 和C++builder 6.0 编译都没有提示出错,但是DOS窗口就一闪而过~求解