fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. struct abc
  5. {
  6. int *x;
  7. };
  8.  
  9. int main()
  10. {
  11.  
  12. struct abc *p =malloc(sizeof(struct abc));
  13. p->x =malloc(sizeof(int));
  14. *p->x = 10;
  15. printf("The value is %d\n",*p->x);
  16. free(p->x);
  17. free(p);
  18. }
  19.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
The value is 10