Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "stdafx.h"
- using namespace std;
- class Object {
- public:
- string& GetName();
- int GetX();
- private:
- string name;
- int x;
- };
- int main() {
- Object o;
- cout << o.GetName().c_str;
- cout << o.GetX();
- getchar();
- return 0;
- }
- int Object::GetX() {
- return x;
- }
- string& Object::GetName() {
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement