You might also find some useful information with sscanf() http://www.cplusplus.com/reference/clibrary/cstdio/sscanf/