Check this : http://www.cplusplus.com/reference/c.../cstdio/fopen/