I'm coming from the PHP world, and it's nice to see the similarities between C & PHP. But I have so many questions! :)
This is a simple fopen() script, easily found online.
What I am wondering about is the buffer variable. I think I understand that it's only looking for 256 characters on a given line.
#include < stdio.h >
int main(void)
{
[B]char buffer[256];[/B]
FILE * myfile;
myfile = fopen("textfile.txt","r");
while (!feof(myfile))
{
fgets(buffer,256,myfile);
printf("%s",buffer);
}
fclose(myfile);
return 0;
}
So, what happens if a text file has an unknown character count per line? Is there an unlimited buffer count option?