Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Calc {
- int wrong;
- public:
- Calc(int wrong)
- {
- this->wrong = wrong;
- cout << "Init\n";
- }
- ~Calc()
- {
- cout << "Destroy!\n";
- }
- void test()
- {
- cout << wrong << "\n";
- }
- };
- int main() {
- Calc* calc = new Calc(2);
- calc->test();
- delete calc;
- /* delete anroper deconstructor.*/
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement