Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following is true about new when compared with malloc.1) new is an operator, malloc is a function2) new calls constructor, malloc doesn’t3) new returns appropriate pointer, malloc returns void * and pointer needs to typecast to appropriate type.(A) 1 and 3(B) 2 and 3(C) 1 and 2(D) All 1, 2 and 3

Answer»
2.

How to create a dynamic array of pointers (to integers) of size 10 using new in C++?Hint: We can create a non-dynamic array using int *arr[10](A) int *arr = new int *[10];(B) int **arr = new int *[10];(C) int *arr = new int [10];(D) Not Possible

Answer» None