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

  • Q : Explain Cohesion Cohesion : The level

    Cohesion: The level to which a component executes a single well-stated task. A strongly cohesive technique, for example, will execute a single task, like adding an item to a data structure, or sorting several data, while a weakly cohesive technique wi

  • Q : Explain Assignment operator Assignment

    Assignment operator: The operator (=) employed to store the value of an expression into the variable, for example: Variable = expression; The right-hand

  • Q : Write a program to display its negative

    Write a program in object code that reads a single digit decimal number and displays its negative in binary.  To do this, you must first read the number as a character and then convert it to its numeric value, as discussed in class.  Then, you're going to change this to a negative numbe

  • Q : Differentiate between RDO and ADO

    Differentiate between RDO and ADO?

  • Q : What is Hash code Hash code : It is a

    Hash code: It is a value returned by a hash function. A hash code can be employed as an index into a random-access data structure, offering a proficient mapping between an object and its position. Employed by classes like HashMap.

  • Q : Explain the good example of XHTML

    Explain the good example of XHTML element opening tags.

  • Q : Define Divide and conquer Divide and

    Divide and conquer: An approach to trouble solving which attempts to decrease an overall single big trouble into multiple simpler troubles.

  • Q : Tower of Hanoi Puzzle program using C#

    Tower of Hanoi Puzzle program using C# and Windows Presentation Foundation (WPF) template in Visual Studio 2012 or newer.

  • Q : Define Iteration Iteration : The

    Iteration: The repetition of a set of statements, generally employing a looping control structure, like a while loop, for loop and do loop.

  • Q : Explain Package declaration Package

    Package declaration: It is a declaration employed to name a package. This should be the first item in the source file, preceding any import statements. For example,     pa

©TutorsGlobe All rights reserved 2022-2023.