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.
.
Last edited by jephthah; Apr 24th, 2009 at 1:25 pm.
Reputation Points: 2143
Solved Threads: 178
Posting Maven
Offline 2,567 posts
since Feb 2008