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 : Limit the Scope of Data Declarations

    Limit the Scope of Data Declarations at the smallest possible level is consistent with the well known principle of data hiding. It stops one module from inadvertently referencing and modifying data values which are only meant to be used by another mod

  • Q : Define process group Define the process

    Define the process group?

  • Q : Use of private Q. Explain the use of

    Q. Explain the use of private, public, protected access specifies.  

  • Q : What is Virtual desktop Virtual desktop

    Virtual desktop: The name employed to explain a user's graphical working area in a window manager. The name arises in the early days of graphical user interfaces whenever it was thought that such would lead to `paperless offices'. This was anticipated

  • Q : Explain the applications of testing

    Explain the applications of testing life cycle.

  • Q : Define TCP endpoint TCP endpoint : It

    TCP endpoint: It is the combination of an IP address and Transmission Control Protocol (abbreviated as TCP) port number.

  • Q : Scalability aspects of a Java PathFinder

    Scalability of program model checkers such as JPF encompasses two aspects: How large a program can be model checked, and Once a defect has been detected, how readily meaningful debugging informati

  • 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 : Explain If-else statement If-else

    If-else statement: It is a control structure employed to select between performing one of two alternative events.     if(boolean-expression){        // Statem

  • Q : Define Scope Scope : A language's scope

    Scope: A language's scope rules establish how broadly variables, methods and classes are visible in a class or program. The local variables contain a scope restricted to the block in which they are stated, for example. Private methods and variables co

©TutorsGlobe All rights reserved 2022-2023.