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.  
  23. printf ("%i %i \n", i2, *pointers.p2);
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
-97 -97