Which of the following is correct about new and malloc?
1.Both are available in C
2.Pointer object initialization of a class with both new and malloc calls the constructor of that class
3.Pointer object initialization of a class using new involves constructor call whereas using malloc does not involve constructor call
4.Pointer object initialization of a class using malloc involves constructor call whereas using new does not involve constructor call
What is the difference between delete and delete[] in C++?
1.delete is used to delete normal objects whereas delete[] is used to pointer objects
2.delete is a keyword whereas delete[] is an identifier
3.delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects
4.delete is syntactically correct but delete[] is wrong and hence will give an error if used in any case
What is virtual inheritance?
1.C++ technique to avoid multiple copies of the base class into children/derived class
2.C++ technique to avoid multiple inheritances of classes
3.C++ technique to enhance multiple inheritance
4. C++ technique to ensure that a private member of the base class can be accessed somehow
Which of the following is correct about new and malloc? i) new is an operator whereas malloc is a function ii) new calls constructor malloc does not iii) new returns required pointer whereas malloc returns void pointer and needs to be typecast
1.i and ii
2. ii and iii
3.i and iii
4. i ii and iii