The information in this article applies to:
SUMMARY
In Microsoft C/C++, the use of a CTRL+Z (hex 1A, decimal 26) is limited in
a file opened in text (translated) mode. If a file contains a CTRL+Z, there
can be only one occurrence of it and it must be the last character in the
file.
MORE INFORMATIONBy using one of the following, these functions will perform as expected if you have multiple CTRL+Zs in the file.
-or- This may necessitate modifications to your I/O routines that deal with newlines (\n) and carriage returns (\r). Examples of Opening Binary FilesThe following opens a file called FILENAME.DAT for both reading and writing in binary mode:
The letter "b" in the access mode designates opening for binary mode.
The following opens a file called FILENAME.DAT for both reading and writing in binary mode.
The O_BINARY constant designates the file to be opened in binary mode.
With both of the file-open commands, it should be noted that the text (translated) mode is the default mode. You may link with an object module called BINMODE.OBJ to change the default mode to binary. This file is located in your LIB subdirectory. This is expected behavior for the Microsoft C/C++ Compiler. Additional query words:
Keywords : kbCRT kbVC100 kbVC150 kbVC200 kbVC400 kbVC500 kbVC600 |
Last Reviewed: July 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |