fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. /* Declare two integers, initialize one to 100 */
  6. int i1 = 100;
  7. int i2;
  8.  
  9. /* note: no tag, and the structure is inside main */
  10. /* structure is not global. It is available only to main */
  11. struct
  12. {
  13. int *p1; /* this member is a pointer */
  14. int *p2; /* and so is this one */
  15.  
  16. } pointers;
  17.  
  18. pointers.p1 = &i1;
  19. pointers.p2 = &i2;
  20.  
  21. *pointers.p2 = -97;
  22. *pointers.p1 = -88;
  23.  
  24. printf ("%i %i \n", i1, *pointers.p2);
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
-88 -97