Table of Contents
Previous Section Next Section

setmode

#include <fstream.h>int setmode(int mode = filebuf::text);

The setmode( ) function is a member of ofstream and ifstream.

The setmode( ) function sets the mode of the associated stream to either binary or text. (Text is the default.) The valid values for mode are filebuf::text and filebuf::binary.

The function returns the previous mode setting or –1 if an error occurs.

A related function is open( ).


Table of Contents
Previous Section Next Section