anxious7
Technical User
- Nov 23, 2007
- 7
struct mystruct
{int *x1;
int x2;};
struct mystruct obj1;
obj1.x1 = malloc(5*sizeof(int));
*obj1.x1=40;
free(obj1.x1);
printf("%d %d \n", *obj1.x1, obj1.x2);
at printf *obj1.x1 is 0.
{int *x1;
int x2;};
struct mystruct obj1;
obj1.x1 = malloc(5*sizeof(int));
*obj1.x1=40;
free(obj1.x1);
printf("%d %d \n", *obj1.x1, obj1.x2);
at printf *obj1.x1 is 0.