Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct Foo {
- int n;
- Foo(int nn) {
- n = nn;
- }
- };
- int main() {
- Foo const *pfoo = new Foo(0);
- std::cout << pfoo->n << std::endl;
- Foo *ppfoo = (Foo*)pfoo;
- ppfoo->n = 1;
- std::cout << ppfoo->n << std::endl;
- }
Add Comment
Please, Sign In to add comment