Advertisement
dllbridge

Untitled

Aug 9th, 2024
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1.  
  2.  
  3. #include  <stdio.h>
  4. #include <string.h>
  5.  
  6.  
  7.  
  8. /////////////////////////////
  9. struct TT
  10. {
  11.      char sz[99];
  12.      
  13.      int  nPoint;  
  14.    
  15. };
  16.  
  17.  
  18.  
  19. TT t_arr[99];
  20.  
  21.  
  22. FILE     *fp;
  23.  
  24. /////////////////////////////////////////////////////
  25. int main()
  26. {
  27.    
  28.    
  29.     fp = fopen("Records.txt", "w");
  30.    
  31.     if(fp == 0) { printf("Error!\n"); return 0; }
  32.    
  33.     strcpy(t_arr[1].sz, "Sonic");
  34.     strcpy(t_arr[2].sz, "Miki ");
  35.     strcpy(t_arr[3].sz, "Maks" );
  36.    
  37.     t_arr[1].nPoint=15;
  38.     t_arr[2].nPoint=25;
  39.     t_arr[3].nPoint=40;
  40.    
  41.    
  42.     fprintf(fp, "Name: %s, Points = %d\n", t_arr[1].sz, t_arr[1].nPoint);
  43.     fprintf(fp, "Name: %s, Points = %d\n", t_arr[2].sz, t_arr[2].nPoint);
  44.     fclose(fp);
  45.    
  46. return 0;    
  47. }
  48.    
  49.    
  50.    
  51.    
  52.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement