Skip to content

Instantly share code, notes, and snippets.

@Samathy
Created February 1, 2016 19:32
Show Gist options
  • Save Samathy/c2adc6001fa98ceab418 to your computer and use it in GitHub Desktop.
Save Samathy/c2adc6001fa98ceab418 to your computer and use it in GitHub Desktop.
#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