fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class A
  5. {
  6. // data members of A
  7. public:
  8. A() { cout << "\n A's constructor";}
  9. };
  10.  
  11. class B
  12. {
  13. A a;
  14. // Other members of B
  15. public:
  16. };
  17.  
  18. int main()
  19. {
  20. //A a;
  21. B b;
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
 A's constructor