-
-
What is the difference between class and structure?
Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public. Class: Class is a successor of Structure. By default all the members inside the class are private.
-
-
-
What is abstraction?
Abstraction is of the process of hiding unwanted details from the user.
-
What is a class?
Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class.
-
-
What is out put of C++ code?
cclass base
{
public:
virtual void display(int i = 10)
{
cout -
-
-
-
What is public, protected, private?
Public, protected and private are three access specifiers in C++. 1. Public data members and member functions are accessible outside the class.2. Protected data members and member functions are only available to derived classes.3. Private data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.
-
Register Relation
Why p++ is faster than p+1?
-
-
Inheritance in C++
While doing inheritance in C++, one thing that is not inherited is what?
-
What is friend function?
As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition.
-
-
Static Polymorphism
What is Static Polymorphism? Give its syntax and simple example.
-
-
C++ Interview Questions
Ans