fork download
  1. #include <stdio.h>
  2.  
  3. struct data {
  4. int foo;
  5. };
  6.  
  7. void func(struct data *table, size_t n){
  8. while(n --> 0){
  9. table[n].foo = n;
  10. }
  11. }
  12.  
  13. #define SIZE 20
  14. int main(void){
  15. struct data table[SIZE];
  16. func(table, SIZE);
  17.  
  18. size_t i = 0;
  19. for(; i < SIZE; ++i)
  20. printf("%d ", table[i].foo);
  21. return 0;
  22. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19