Created
November 20, 2017 23:18
-
-
Save codyhex/eb8b29a2c90fc5638285ac8992dd3027 to your computer and use it in GitHub Desktop.
virtual_table_at_head created by Hexe - https://repl.it/@Hexe/virtualtableathead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct A | |
{ | |
int data[2]; | |
A(int x, int y) : data{x, y} {} | |
virtual void f() {} | |
}; | |
int main(int argc, char **argv) | |
{ | |
A a(22, 33); | |
int *arr = (int *) &a; | |
std::cout << arr[2] << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment