fork download
  1. #include <stdio.h>
  2.  
  3. struct Coordinate {
  4. int x;
  5. int y;
  6. int z;
  7. };
  8.  
  9. int main() {
  10.  
  11. struct Coordinate pos;
  12.  
  13. struct Coordinate *ptr = &pos;
  14.  
  15.  
  16. ptr->x = 10;
  17. ptr->y = 20;
  18. ptr->z = 30;
  19.  
  20.  
  21. printf("x: %d, y: %d, z: %d\n", pos.x, pos.y, pos.z);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
x: 10, y: 20, z: 30