I did now, I thought the red text was just important, but they turned out to be links :p. Silly me.
I now used this in stead of scanf:
But now if i type the string blablabla and use:Code:
printf("Give the name of the file you wish to analyze.\n");
fgets(datafile, 1024, stdin);
It prints this on the screen:Code:
printf("File '%s' not found...\n", filenames);
' not found...
I read, if I wanted to get rid of the unwanted newline I should use:
But where do I use it? I tried it above fgets and below, and used "datafile" in stead of "buffer". I still get the unwanted newline.Code:
buffer[ strlen(buffer) ] = '\0';