LIST-I (file mode parameters) LIST-II (Meaning) A. ios::ate I. Go to end of file on opening B. ios::in II. Open fails if the file already exists. C. ios::nocreate III. Open file for reading only D. ios::noreplace IV. Open fails if the file does not exist.
This question requires matching C++ file stream opening mode parameters (LIST-I) with their corresponding meanings (LIST-II). These parameters control how a file is opened and accessed.
Based on the definitions, the correct pairings are:
| LIST-I | LIST-II |
| A. ios::ate | I. Go to end of file on opening |
| B. ios::in | III. Open file for reading only |
| C. ios::nocreate | IV. Open fails if the file does not exist |
| D. ios::noreplace | II. Open fails if the file already exists |
Therefore, the correct combination is A-I, B-III, C-IV, D-II.
Let A be the base class in C++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?
Which of the following statements are true regarding C++?
(a) Overloading a function gives the capability to an existing operator to operate on other data types.
(b) Inheritance in object-oriented programming provides support to reusability.
(c) When object of a derived class is defined, first the constructor of derived class is executed then constructor of a base class is executed.
(d) Overloading is a type of polymorphism.
Choose the correct option from those given below:Match List I with List II
| List I | List II | ||
| (Programming Paradigm) | (Characteristic) | ||
| A. | Imperative | I. | Declarative, clausal representation, theorem proving |
| B. | Object‐oriented | II. | Side‐effect free, declarative, expression evaluation |
| C. | Logic | III. | Imperative, abstract data type |
| D. | Functional | IV. | Command‐based, procedural |
Choose the correct answer from the options given below :
A member function can always access the data in _______, (in C++).
Which of the following is not correct for virtual function in C++?