1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void savetext(struct Employee e[], int n)
{
    FILE *outfile;
    outfile = fopen ("employees.txt", "w");
    if (outfile == NULL)
        {
            fprintf(stderr, "\nError opend file\n");
            exit (1);
        }
    for (int i = 0; i< n; i++)
        {
            fwrite (&e[i], sizeof(struct Employee), 1, outfile);
        }
    fclose (outfile);
    //save the struct to text file employees.txt
}
 
cs


앞에 있는것들을 저장하는건데 이 함수 자체는 틀린거없지않아?


왜 만들어진 파일 열면 글자 다 깨져있지