daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include "stdafx.h"
  3.  
  4. using namespace std;
  5.  
  6. class Object {
  7. public:
  8.     string& GetName();
  9.     int GetX();
  10. private:
  11.     string name;
  12.     int x;
  13. };
  14.  
  15. int main() {
  16.     Object o;
  17.     cout << o.GetName().c_str;
  18.     cout << o.GetX();
  19.     getchar();
  20.  
  21.     return 0;
  22. }
  23.  
  24. int Object::GetX() {
  25.     return x;
  26. }
  27.  
  28. string& Object::GetName() {
  29.     return name;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top