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: A destructor is automatically called when the object is destroyed A virtual destructor in C++ is used primarily to prevent resource leaks by performing a clean-up of the object
Correct Answer: All the features of C are similiar to C++ except some features, such as polymorphism, operator overloading which are supported in C++ but not in C language Both C and C++ language is similiar in their functionality but C++ provides with more tools and options
5. What are the basic concepts of object oriented programming?
Correct Answer: It is necessary to understand some of the concepts used extensively in object oriented programmingThese include Objects Classes Data abstraction and encapsulation Inheritance Polymorphism Dynamic Binding Message passing
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: 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