第三章课后题(P146_4_2)

#include <iostream>
using namespace std;

class CTest
{
private:
int n;
public:
CTest()
{
n = 1;
}
int GetValue() const
{
return n;
}
int GetValue()
{
return 2 * n;
}
};
int main()
{
const CTest objTest1;
CTest objTest2;
cout << objTest1.GetValue() << "," << objTest2.GetValue()<<endl;
system("pause");
return 1;
}

posted @ 2020-03-13 10:25  CollisionDimension  阅读(93)  评论(0)    收藏  举报