fork download
  1. #include <stdio.h>
  2.  
  3.  
  4.  
  5.  
  6. class A
  7.  
  8. {
  9. int x;
  10.  
  11. public:
  12.  
  13. A(int a = 0) : x(a) {printf("\nKONSTRUKTOR class A this = %p\n",this);}
  14. ~A() {printf("\nDESTRUKTOR class A this = %p\n",this);}
  15. int hgh() const {return x;}
  16.  
  17. class B
  18.  
  19. {
  20. public:
  21.  
  22. B() {printf("\nKONSTRUKTOR class B this = %p\n",this);}
  23. ~B() {printf("\nDESTRUKTOR class B this = %p\n",this);}
  24. void gfk() const
  25.  
  26. {
  27. A v(564);
  28. printf("\nv = %p\n",&v);
  29. printf("\nx = %d\n",v.x);
  30. }
  31. };
  32. };
  33.  
  34.  
  35.  
  36. int main()
  37.  
  38. {
  39. A::B b;
  40.  
  41.  
  42.  
  43.  
  44. return 0;
  45. }
  46.  
  47.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
KONSTRUKTOR class B this = 0xbf94bf2f

DESTRUKTOR class B this = 0xbf94bf2f