Created
February 1, 2016 19:32
-
-
Save Samathy/c2adc6001fa98ceab418 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
#include <stdlib.h> | |
struct test | |
{ | |
char c; | |
char i; | |
}; | |
int main() | |
{ | |
char * p = malloc (2);//Alloc 2 bytes | |
p = (struct test * )p; | |
printf("%c", p->c); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment