MCQ Bank
Name the function whose definition can be substituted at a place where its function call is made _________.
- A) friend function
- B) inline function
- C) volatile function
- D) static function
Which is not true regarding structures?
- A) d) Both b & c
- B) b) We can take the size of structure
- C) c) We can’t declare pointers to structure
- D) a) We can declare arrays of structure
We cannot declare a function as a friend of ________ classes
- A)
- B)
- C)
- D)
By writing aFile.seekg(15L, ios::cur) we are moving ______________.
- A) 15 bits in the backward direction starting from the current position
- B) 15 bytes in the forward direction starting from the current position
- C) 15 bits in the backward direction starting from the previous position
- D) 15 bytes in the backward direction starting from the current position
Automatic variable are created constantly and destroyed
- A)
- B)
- C)
- D)
Default constructor generated by ______________does ______________for us.
- A) main program, memory management
- B) compiler, no initialization
- C) classes , initialization
- D) compiler , initialization
________ are a conditional compilation process that is used to replace a piece of code by its definition in a program
- A)
- B)
- C)
- D)
The dynamic memory allocation uses ___________ whereas static memory allocation uses _________.
- A) classes , array
- B) array , stack
- C) stack , lists
- D) heap , stack
calloc() function allocates multiple blocks of memory and each block have ________ ?
- A)
- B)
- C)
- D)
What is the main purpose of the C preprocessor?
- A) Translate object code into machine code
- B) Execute the program
- C) Enhance the C language by preprocessing code before compilation
- D) Optimize the executable file
in C++ sizeof operator is used to determine ________
- A)
- B)
- C)
- D)
What allows an object to interact with private data members of a class?
- A) Inheritance
- B) Pointers
- C) Global variables
- D) Public member functions
which of the following header file deals with stream extraction?
- A)
- B)
- C)
- D)
Public member functions of the class ______________main program.
- A) are accessible in
- B) are not accessible in
- C) are private to
- D) are defined within the
Type to use getch() function without including #include<conio.h> header file in the program is a ________ error
- A)
- B)
- C)
- D)
Destructor _______________________.
- A) takes no arguments and can be overloaded
- B) cannot be overloaded and have return type
- C) can be overloaded and have return type
- D) cannot be overloaded and have no return type
in C++ the default constructor takes ________
- A)
- B)
- C)
- D)
We cannot use ______________ pointer for storing and reading data from it.
- A) double
- B) NULL
- C) integer
- D) zero
in C++ the name of the ________ is the same as that of a class with a preceding tilde (~) sign.
- A)
- B)
- C)
- D)
Which of the following is the default mode of the file opening while using the ofstream class?
- A) ios::trunc
- B) ios::app
- C) ios::out
- D) ios::in