I have a function that gets a string from the user and then does the following
FILE *pIn;
FILE *pOut;
pIn = fopen(inFile, "r");
char c;
if (pIn == NULL)
{
printf("File not found");
}
pOut = fopen(outFile, "w");
if (pOut == NULL)
{
fclose(pIn);
printf("The write file cannot be opened.\n");
exit(1);
}
else{
while(!feof(pIn)) //while it is not the end of input file
{
c = fgetc(pIn);
c = tolower(c);
fputc(c,pOut);
//fprintf(pOut,c);
}
fclose(pOut);
}
fclose(pIn);
Two things are happening: the while loop is giving me a segmentation fault. And the creation of the second file has a weird dot next to the txt name (see picture).
