Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class A
- {
- };
- class B : A
- {
- public:
- int magic;
- };
- void evilFunc(A as[])
- {
- A a;
- as[0] = a;
- }
- int main(void)
- {
- B bs[1];
- evilFunc(bs);
- std::cout << bs[0].magic << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment