C++ Questions

Q:

What are storage qualifiers in C++ ?

Answer

ConstKeyword indicates that memory once initialized, should not be altered by a program.
Volatile keyword indicates that the value in the memory location can be altered even though nothing in the program.
Mutable keyword indicates that particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is constant.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2626
Q:

What is the difference between class and structure?

Answer

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.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2467
Q:

What is dynamic binding?

Answer


Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run time.It is associated with polymorphism and inheritance.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2424
Q:

What do you mean by early binding?

Answer

Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2247
Q:

What do you mean by reference variable in c++?

Answer

A reference variable provides an alias to a previously defined variable.
Data -type & reference-name = variable name

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2237
Q:

List the advantages of inheritance

Answer

- Inheritence permits code reusability. 


- Reusability saves time in program development. 


- It encourages the reuse of proven and debugged high-quality software which reduces the problems after a system becomes functional.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2200
Q:

What is default constructor?

Answer


A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2186
Q:

What are the basic concepts of object oriented programming?

Answer

It is necessary to understand some of the concepts used extensively in object oriented programming.These include


Objects
Classes
Data abstraction and encapsulation
Inheritance
Polymorphism
Dynamic Binding
Message passing

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2181