#include header files...
FILE *file = fopen("existing text file.txt", "rt");
char buffer[8]; // yes really eight
fgets(buffer, 8, file); // <---- this line screws up
That should work AFAIK but it doesn''t. I must be making some very stupid mistake... but which one?
Anyone?
Very stupid fgets question
I just can''t find anything wrong here:
you sure the text file exists that you try to open? see if (after the opening attempt) that the FILE structure is not null.
are you getting any error messages?
are you getting any error messages?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement