Advertisement
STANAANDREY

arrow_op

Jun 28th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. class entity
  5. {
  6.  public:
  7.      int x;
  8.      void say_hello()
  9.     {
  10.         cout<<"hello";
  11.     }
  12. };
  13.  
  14. int main()
  15. {
  16.  entity *e=new entity();
  17.  e->say_hello();
  18.  e->x=3;
  19.  cout<<(*e).x<<endl;
  20.  cout<<(e->x==(*e).x);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement