C++ Interview
C++ Interview Question and Answers:31. What is a dynamic constructor?
The constructor can also be used to allocate memory while creating objects. Allocation of memory to objects at the time of their construction is known as dynamic construction of objects.The memory is allocated with the help of the new operator.
32. What is the use of ‘using’ declaration?
A using declaration makes it possible to use a name from a namespace.
33. what is difference between function overloading and operator overloading?
A function is overloaded when same name is given to different function.
While overloading a function, the return type of the functions need to be the same.
34. What is the difference between an Array and a List?
The main difference between an array and a list is how they internally store the data. whereas Array is collection of homogeneous elements. List is collection of heterogeneous elements.
35. What are the advantages of inheritance?
Code reusability
Saves time in program development.
No comments:
Post a Comment