11) What are the methods of exporting a function from a DLL?
There are two ways:
By using the DLL's type library.
Taking a reference to the function from the DLL instance.
12) Define friend function.
Friend function acts as friend of the class. It can access the private and protected members of the class. The friend function is not a member of the class but it must be listed in the class definition.
13) What is virtual function?
A virtual function is used to replace the implementation provided by the base class. 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.
14) When should we use multiple inheritance?
You can answer this question in three manners:
Never
Rarely
If you find that the problem domain cannot be accurately modeled any other way.
15) What is the destructor?
Destructor is used to delete any extra resources allocated by the object.
16) What is an overflow error?
It is a type of arithmetical error. It is happen when the result of an arithmetical operation been greater than the actual space provided by the system.
17) What is overloading?
C++ facilitates you to specify more than one definition for a function name or an operator in the same scope. It is called function overloading and operator overloading respectively.
18) What is function overriding?
If you inherit a class into a derived class and provide a definition for one of the base class's function again inside the derived class, then this function is called overridden function and this mechanism is known as function overriding.
19) What is virtual inheritance?
Virtual inheritance facilitates you to create only one copy of each object even if the object appears more than one in the hierarchy.
20) What is constructor?
Constructor is a special method that initializes object. It name must be same as class name.
21) What is the purpose of "delete" operator?
The "delete" operator is used to release the dynamic memory created by "new" operator.
22) Explain this pointer?
This pointer holds the address of current object.
23) What does Scope Resolution operator?
A scope resolution operator(::) is used to define the member function outside the class.
24) What is the difference between delete and delete[]?
Delete [] is used to release the array of allocated memory which was allocated using new[] whereas delete is used to release one chunk of memory which was allocated using new.
0 Comments
If you have any doubts,please let me know