prog.cpp: In function 'int main()':
prog.cpp:7:3: error: 'X::~X()' is protected
~X() {}
^
prog.cpp:17:7: error: within this context
X x2; // syntax error
^
prog.cpp:7:3: error: 'X::~X()' is protected
~X() {}
^
prog.cpp:22:12: error: within this context
delete xp; // syntax error
^
prog.cpp: In function 'void __static_initialization_and_destruction_0(int, int)':
prog.cpp:7:3: error: 'X::~X()' is protected
~X() {}
^
prog.cpp:14:3: error: within this context
X x1; // syntax error
^
Standard output is empty
Advanced CPP: Memory usage Objects only in the HEAP