fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo
  5. {
  6. Foo(int n) { cout << "Param CONSTRUCTOR!!!\n"; }
  7. Foo(const Foo&) { cout << "COPY CONSTRUCTOR!!!\n"; }
  8. };
  9.  
  10. Foo* make_foo(int n)
  11. {
  12. return new Foo(n);
  13. }
  14.  
  15. int main() {
  16. // your code goes here
  17. Foo *obj1 = make_foo(2);
  18. return 0;
  19. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Param CONSTRUCTOR!!!