Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

_fmode

The _fmode variable sets the default file-translation mode for text or binary translation. This global variable has been deprecated in Visual C++ 2005 for the more secure functional versions _get_fmode and _set_fmode, which should be used in place of the global variable. It is declared in Stdlib.h as follows.

extern int _fmode;

The default setting of _fmode is _O_TEXT for text-mode translation. _O_BINARY is the setting for binary mode.

You can change the value of _fmode in three ways:

  • Link with Binmode.obj. This changes the initial setting of _fmode to _O_BINARY, causing all files except stdin, stdout, and stderr to be opened in binary mode.

  • Make a call to _get_fmode or _set_fmode to get or set the _fmode global variable, respectively.

  • Change the value of _fmode directly by setting it in your program.

Community Additions

ADD
Show:
© 2015 Microsoft