fork download
  1. #include <iostream>
  2.  
  3. struct S {
  4. int v;
  5. S() : S(42) {}
  6. S(int v) : v(v) {}
  7. };
  8.  
  9. int main() {
  10. S *s1 = new S(5);
  11. S *s2 = new S();
  12.  
  13. std::cout << s1->v << " " << s2->v << std::endl;
  14. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
5 42