Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- class myclass {
- private:
- int secret;
- public:
- myclass(int i) : secret(i * 7) { }
- };
- struct myclone {
- int secret;
- };
- int main(int argc, char *argv[])
- {
- myclass mc(3);
- struct myclone *cl = (struct myclone *)&mc;
- printf("%d\n", cl->secret);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement