Sunday, September 13, 2009

Tips

* fgetc gets one character by character. So if you have 12 followed by newline written in a file, fgets will return 1 in the first call, 2 in the second call and 10 (for newline) in third call.

*fgets reads characters until it encounters a newline character. newline is considered as a valid character and therefore it is included in the string copied.

No comments:

Post a Comment