* /
* Copyright (c) 2011, 烟台大学计算机学院
* All rights reserved.
* 作 者: 孙培培
* 完成日期:2013 年 4月9日
* 版 本 号:v1.0
* 输入描述:
* 问题描述:
*/
#include<iostream>
#include<stdlib.h>
using namespace std;
class C
{
private:
int x;
public:
C(int x){this->x = x;}
int getX(){return x;}
};
int main()
{
C c(5);
cout<<c.getX()<<endl;
return 0;
}
#include<iostream>
#include<stdlib.h>
using namespace std;
class C
{
private:
int x;
public:
C(int x){this->x = x;}
int getX()const{return x;}
};
int main()
{
const C c(5);
C c1(7);
cout<<c.getX()<<endl;
cout<<c1.getX()<<endl;
return 0;
}