FILE* foc = NULL;
err = fopen_s(&foc, "save.txt", "wt");
if (err == 0)
printf("save.txt file created\n");
printf("1. Enter string : ");
printf("2. What I wrote in the file: %s\n", sts);
for (cnt = 0; sts[cnt] != NULL; cnt++);
printf("save.txt file close successfully\n");
printf("Save.txt file creation failed\n";
I ran it and opened the save.txt file, but nothing was recorded.
For your information, I wrote down the example questions in the book and checked several times to see if they were correct, so is there any other reason?