fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct test
  5. {
  6. test() { cout << "default constructor on " << this << endl; }
  7. test(int) { cout << "int constructor on " << this << endl; test(); }
  8. };
  9.  
  10. int main() {
  11. test t(1);
  12. cout << "test object at " << &t << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
int constructor on 0xbfa57e9e
default constructor on 0xbfa57e9f
test object at 0xbfa57e9e