- #include <iostream>
- using namespace std;
- class C
- {
- private:
- int x;
- public:
- C(int x){this->xx = x;}
- int getX(){return x;}
- };
- void main()
- {
- C c(5);
- cout<<c.getX();
- system("pause");
- }
- #include <iostream>
- using namespace std;
- class C
- {
- private:
- int x;
- public:
- C(int x){this->xx = x;}
- int getX()const
- {return x;}
- };
- void main()
- {
- C c(5);
- cout<<c.getX();
- system("pause");
- }