fscanf
http://www.cplusplus.com/reference/c...cstdio/fscanf/
Return Value
On success, the function returns the number of items successfully read. This count can match the expected number of readings or be less -even zero- in the case of a matching failure.
In the case of an input failure before any data could be successfully read, EOF is returned.