Ever wondered how can you design a class in C++ which can’t be inherited. Java and C# programming languages have this feature built-in. You can… Read More »
Predict the output of following C++ program.
In the virtual constructor idiom we have seen the way to construct an object whose type is not determined until runtime.
Can we make a class constructor virtual in C++ to create polymorphic objects?
A class declared inside a function becomes local to that function and is called Local Class in C++. For example, in the following program, Test… Read More »
Predict the output of following program?
Default parameters for templates in C++: Like function default arguments, templates can also have default arguments. For example, in the following program, the second parameter… Read More »
In C++, if a derived class redefines base class member method then all the base class methods with same name become hidden in derived class.
A constructor without any arguments or with default value for every argument, is said to be default constructor. What is the significance of default constructor? Will… Read More »
Initializer List is used to initialize data members of a class. The list of members to be initialized is indicated with constructor as a comma… Read More »
When are the constructors called for different types of objects like global, local, static local, dynamic?
In C++, variables are passed by reference due to following reasons:
In C/C++, arrays and pointers have similar semantics, except on type information.
In C++, the programmer abstracts real world objects using classes as concrete types. Sometimes it is required to convert one concrete type to another concrete… Read More »
Write a one line C function that calculates and returns . For example, if n = 64, then your function should return 6, and if… Read More »