Correct 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 timeIt is associated with polymorphism and inheritance
Correct 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
Correct Answer: Late binding refers to function calls that are not resolved until run time Virtual functions are used to achieve late binding When access is via a base pointer or reference, the virtual function actually called is determined by the type of object pointed to by the pointer
Correct 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
8. What do you mean by multiple inheritance in C++ ?
Correct Answer: Multiple inheritance is a feature in C++ by which one class can be of different types Say class teaching Assistant is inherited from two classes say teacher and Student
9. What is the difference between realloc() and free()?
Correct Answer: The free subroutine frees a block of memory previously allocated by the malloc subroutine Undefined results occur if the Pointer parameter is not a valid pointer If the Pointer parameter is a null value, no action will occur The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines Undefined results occur if the Pointer parameter is not a valid pointer
10. What is the difference between class and structure?
Correct 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