fork download
  1. #include <stdio.h>
  2. typedef struct{
  3. int id;
  4. char blood_type;
  5. double height;
  6. }list;
  7.  
  8. void display( list data[]);
  9. int main(void) {
  10. list data[]={
  11. {1,'A',165.2},{ 2,'O',155.5}
  12. };
  13. display (data);
  14. return 0;
  15. }
  16.  
  17. void display( list d[]){
  18. for(int i=0; i<2; i++){
  19. printf("%d\n",d[i].id);
  20. printf("%c\n",d[i].blood_type);
  21. printf("%lf\n",d[i].height);
  22. }
  23. }
  24.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
1
A
165.200000
2
O
155.500000