Monday, January 12, 2009

Using fgets to read a file in C

while(fgets(buffer, length, file pointer)!=null)
Do Something

Noticeable thing here is that one should use null for identifying the end of file instead of EOF as fgets returns null.

No comments:

Post a Comment