-
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?
-
C++ Multiple Inhiretence
Why multiple inheritance is supported in C++? What is reason?
-
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();}
-
-
-
-
-
Arithmetic Operations using Operator Overloading
Write a program for all the four arithmetic operations in float data type using operator overloading concept.
-
-
Invoke the virtual toString() function
To invoke the virtual toString() function defined in GeometricObject from a Circle object c, use :A. ((GeometricObject*)c)->toString();B. c.super.toString()C. (GeometricObject*)c->toString();D. c->GeometricObject::toString()
-
-
C++ Interview Questions
Ans