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