fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Number
  5. {
  6. public:
  7. // Implicit CTOR since we didn't define one
  8. // Non initialized member
  9. int notGood;
  10.  
  11. virtual void f(){}
  12. };
  13.  
  14. // isGood.notGood will be 0;
  15. Number isGood;
  16.  
  17. int main()
  18. {
  19. Number wontWork;
  20. cout << wontWork.notGood << endl;
  21. cout << isGood.notGood << endl;
  22. return 0;
  23. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
-1217892364
0