fork download
  1. #include<stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct dane
  5. {
  6. int liczba;
  7. float liczba2;
  8. };
  9.  
  10. int main()
  11. {
  12.  
  13. struct dane* tab;
  14.  
  15. tab = malloc(4*sizeof(struct dane));
  16.  
  17. int i;
  18. for(i=0; i<4; i++)
  19. {
  20. tab[i].liczba=i*3;
  21. tab[i].liczba2=i*1.1 + 0.5;
  22. }
  23.  
  24. for(i=0; i<4; i++)
  25. printf("%d %f\n",tab[i].liczba, tab[i].liczba2);
  26.  
  27. free (tab);
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 1964KB
stdin
Standard input is empty
stdout
0   0.500000
3   1.600000
6   2.700000
9   3.800000