fork download
  1. #include<iostream>
  2. class Myclass
  3. {
  4. //int i
  5. public:
  6. void doSomething()
  7. {
  8. std::cout<<"Inside doSomething";
  9. //i = 10;
  10. }
  11. };
  12.  
  13. int main()
  14. {
  15. Myclass *ptr = new Myclass;
  16. delete ptr;
  17.  
  18. ptr->doSomething();
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
Inside doSomething