Created
August 30, 2012 16:17
-
-
Save mhx/3532140 to your computer and use it in GitHub Desktop.
This file contains 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
marcus@balrog ~ $ cat test.cpp | |
#include <iostream> | |
struct Versuch { | |
int foo1; | |
int foo2; | |
int foo3; | |
int foo4; | |
}; | |
int main() | |
{ | |
Versuch *v = new Versuch; | |
v->foo1 = 1; | |
v->foo2 = 2; | |
v->foo3 = 3; | |
v->foo4 = 4; | |
int *p = &v->foo1; | |
for (size_t i = 0; i < 4; ++i) | |
std::cout << p[i] << std::endl; | |
return 0; | |
} | |
marcus@balrog ~ $ g++ -o test test.cpp | |
marcus@balrog ~ $ ./test | |
1 | |
2 | |
3 | |
4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment