codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <stdio.h> int main() { bool test = false; // == 0 printf("value of test: <%d>\n", test); test++; // == 1 printf("value of test: <%d>\n", test); test++; // == 1 printf("value of test: <%d>\n", test); //but now with some magic void* pnt = &test; unsigned char& magic = *(unsigned char*)pnt; //magic now points to the same addres as test //here it gets strange... magic = 137; printf("value of test: <%d> -- 137 wtf?!\n", test); //137 wtf?! magic++; printf("value of test: <%d>\n", test); return 0; }
Private
[
?
]
Run code
Submit