-
-
Base Class Destructor
In C++, which of following statements accurately describe a base class destructor calling a virtual function override of a derived class?A. the base class destructor calls the virtual function of the base class and not of the derived class.B. the base class destructor calls the virtual function override of the derived class through th vtable.C. the C++ compiler maintains the overridden virtual function...
-
Multi-Dimension Array Size
If you need a function that will handle multi-dimensional arrays, you must specify the following sizes inside the square brackets.Choose one answer. a. All sizes except the first dimension b. None of the sizes c. All sizes except the last dimension d. All the sizes
-
Exception Handling
Explain the exception handling features of C++ program with a suitable example
-
Private Inheritance question
Hi I very recently did the C++ online Quiz and was surprised to find that my answer (1) to the following question (below) was incorrect. Is there something I am missing here, or is the answer incorrect. I thought this was the point of Private. "Always inaccessible regardless or derivation access".Apparently (3) in the correct answer! according to the quiz!The private member in derived class ...
-
GOD of Two Numbers
Write a C++ program to find the GOD of two numbers
-
Inheritance
What is inheritance? why we use it? plzz can anybody explain me with one example and where we use that concept?
-
Constant, Volatile and Static Function
What is the use of constant function, volatile function & static function (in programming & real life)? How do they differ from one another?
-
Memory Resize Function
Lets say contiguous memory is not available for vector's elements and it is occupied by something else. How does the resize function of vector allocate memory to be contiguous allocation?
-
What are virtual functions?
A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't...
-
What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call....
-
What is a template?
Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones: template identifier> function_declaration; template identifier> function_declaration; The only difference between...
-
What is the advantage of function overloading according to users point of view?
I know that function name is same. but each time we are writing code for each function.then in which way it is advantageous than normal function.
-
Nested Classes
Do Nested Clases exists? If so, where are they used?
-
Spiral Structure
Write a program for generating a spiral structure of N number.For example: If N= 4 then the structure will be as follow-1 24 3 If N=5, then the structure will be as follow- 1 25 4 3 If N=9, then the structure will be as follow-7 8 96 1 25 4 3 If N=15, then the structure will be as follow-7 8 9 106 1 2 115 4 3 12 15 14 13 If N=18, then the structure will be as follow- 7 8 9 10 6...
-
Will the program run successfully?
Main(){ int a=2.9; float b=9; cin>>"%d %f">>a>>b; return();}
-
-
-
-
C++ Interview Questions
Ans