Schau mal hier:
http://www.cplusplus.com/reference/cstdio/fgets/