File handling modes and corresponding flags

Q. Describe file handling modes and corresponding flags with examples in C++.

Ans. File handling modes specifiers the purpose for which the file is opened. The file mode parameters can take one (or more) of such constants defined in the class ios. Lists the file parameters and their meanings. Opening a file ios : : out mode also opens it is the ios : : trunk mode by default. Both ios : : app and ios : : ate us to the end of the file when it is opened. The distinction between the two parameters is that the ios : : app mode permits us to add data or to modify the existing data anywhere in the file. In both the cases, a file is created by the specifier name, if it does not exist. The parameter can be used only with the file capable of output. The mode can combine two or more parameters using the bitwise OR operator (symbol ||).

 

 

 

 

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.