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