use " fopen() " to open the file, and specify "read, binary" as the mode.
FILE * fp;
fp = fopen("file.dat","rb"); note the following:In the case of text files, depending on the environment where the application runs, some special character conversion may occur in input/output operations to adapt them to a system-specific text file format. In many environments, such as most UNIX-based systems, it makes no difference to open a file as a text file or a binary file; Both are treated exactly the same way, but differentiation is recommended for a better portability
-- http://www.cplusplus.com/reference/clibrary/cstdio/fopen/
in other words, if you think the file has numeric values, read them the same way using fgets() or sscanf() or similar.
.