fork(11) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class TestClass
  5. {
  6. public:
  7. TestClass();
  8. ~TestClass();
  9. };
  10. TestClass::TestClass()
  11. {
  12. cout<<"Created."<<endl;
  13. }
  14.  
  15. TestClass::~TestClass()
  16. {
  17. cout<<"Destroyed"<<endl;
  18. }
  19.  
  20. int main() {
  21. for (int i = 0; i < 5; ++i)
  22. {
  23. TestClass c;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Created.
Destroyed
Created.
Destroyed
Created.
Destroyed
Created.
Destroyed
Created.
Destroyed