Advertisement
henke37

Pointer variable and argument

Mar 4th, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class T {
  2.     int a;
  3. };
  4.  
  5. T *d=new T();
  6.  
  7. d->a=4;
  8. void f(T *s) {
  9.     cout<< s->a;
  10.     s=new T();
  11.     s->a=5;
  12.     cout<< s->a;
  13. }
  14.  
  15. f(d);
  16. cout<< d->a;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement