Hi, I am currently making a program which has to read a certain line from a file, this is no problem, but the string returned from fgets() contains two strange symbols at the end of the word, a music note and a circle, don't know why these are there, nothing like that is present in the textfile
here's a summary of the code I'm using:
Code:
FILE * pFile;
int aantalLijnen = 0;
int randomLijn = 1;
char opgave[25];
pFile = fopen ("hangman.txt" , "rb");
if (pFile==NULL)
{
//error handling
}
while( fgets(opgave,sizeof(opgave),pFile) != NULL)
aantalLijnen++;
if(aantalLijnen == 0)
{
//error handling
}
randomLijn = rand() % (aantalLijnen+1);
rewind(pFile);
fgets(opgave,sizeof(opgave),pFile);
fclose(pFile);
printTextScreen(10,80,opgave,RGB(255,255,255));
flipScreen();
don't mind the printTextScreen() and flipScreen(), they are just functions of my graphics library