Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct
- {
- int *p;
- int a;
- } foo;
- int main(int argc, const char * argv[])
- {
- foo *temp = (foo*)malloc(sizeof(foo));
- int x = 10;
- temp->p = &x;
- temp->a = 999;
- //printf("%x\n", temp->p);
- //printf("%x\n", &x);
- int a = 0;
- void* f = temp;
- for(a;a < 9;a++)
- {
- printf("%d\n", *((int*)(f)));
- f++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement