Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct ball
  5. {
  6. char name[1000],int number[1000],int time[1000]
  7. };
  8. void fill_table(struct ball *bl,int *p);
  9. void show_table(struct ball *bl,int size);
  10.  
  11.  
  12. int main ()
  13. {
  14. struct ball bl;
  15.  
  16. int size;
  17. int *p;
  18. size=0;
  19. p=&size;
  20. fill_table(ball bl,&size);
  21. show_table(ball bl,size);
  22.  
  23.  
  24.  
  25.  
  26. return 0;
  27. }
  28.  
  29. void fill_table(struct ball *bl,int *p)
  30. {
  31. int i,x;
  32. FILE *fp;
  33. fp=fopen("player.txt","w");
  34. printf("dwse 1 gia stxia alliws -1 na men se pari kanenas poutsos");
  35. scanf("%d",&x);
  36. if (x==1)
  37. {
  38. for (i=0; i<1000; i++)
  39. {
  40. printf("dwse stxia paiktarou");
  41. scanf("%s\n",bl.name[i]);
  42. printf("dwse stxia paiktarou");
  43. scanf("%d\n",bl.number[i]);
  44. printf("dwse stxia paiktarou");
  45. scanf("%d\n",bl.time[i]);
  46. *p=*p+1;
  47. fprinf("onoma %s arithmos %d xronos %d/n",bl.name[i],bl.number[i],bl.time[i]);
  48. fclose(fp);
  49. }
  50. }
  51.  
  52. }
  53.  
  54. void show_table(struct ball *bl,int size)
  55. {
  56. int i;
  57.  
  58. for (i=0; i<size; i++)
  59. {
  60. printf("onoma %s arithmos %d xronos %d/n",bl.name[i],bl.number[i],bl.time[i]);
  61. printf("\n");
  62. }
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement