Could someone point out why my exit character 'x' is being written to my sequential file? I would really appreciate it. Thank You!
Also if you see any improvements I can make, please feel free to point it out. With that being said, please be kind.
#define N 100
fP = fopen("names.dat", "w");
if ((fP = fopen("names.dat", "w")) == NULL)
printf("%s not opened", "names.dat");
printf("This program will write names and GPAs into a file named names\n");
printf("Please enter an x to exit the program.\n");
for(i=0; i<N; i++)
while (i < N && *str != 'x')
printf("Please enter a student's name and their GPA separted by a space.\n");