Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct A
- {
- A() { std::cout << "A" << std::endl; }
- ~A() { std::cout << "~A" << std::endl; }
- };
- int main()
- {
- A *a = new A();
- A *b = new (a) A();
- delete b;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement