分类: C/C++
2010-06-28 11:29:24
fscanf(stream, "%[^\n]%*c", line)
FILE *stream;
char line[80];
while ((fscanf(stream, "%[^\n]", line)) != EOF )
{
printf("Line = %s \n",line);
}
FILE *stream;
char line[80];
while ((fscanf(stream, "%[^\n]", line)) != EOF)
{
fgetc(stream); // Reads in '\n' character and moves file
// stream past delimiting character
printf("Line = %s \n", line);
}