Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - #include <stdio.h>
 - #include <string.h>
 - /////////////////////////////
 - struct TT
 - {
 - char sz[99];
 - int nPoint;
 - };
 - TT t_arr[99];
 - FILE *fp;
 - /////////////////////////////////////////////////////
 - int main()
 - {
 - fp = fopen("Records.txt", "w");
 - if(fp == 0) { printf("Error!\n"); return 0; }
 - strcpy(t_arr[1].sz, "Sonic");
 - strcpy(t_arr[2].sz, "Miki ");
 - strcpy(t_arr[3].sz, "Maks" );
 - t_arr[1].nPoint=15;
 - t_arr[2].nPoint=25;
 - t_arr[3].nPoint=40;
 - fprintf(fp, "Name: %s, Points = %d\n", t_arr[1].sz, t_arr[1].nPoint);
 - fprintf(fp, "Name: %s, Points = %d\n", t_arr[2].sz, t_arr[2].nPoint);
 - fclose(fp);
 - return 0;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment