Which of the following is true about new when compared with malloc.
1) new is an operator, malloc is a function
2) new calls constructor, malloc doesn't
3) 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,3
Correct Answer:
Verified
Q11: What is the difference between struct and
Q12: Predict the output of following C++ program#include<iostream>
Q13: class Test { int x;};int main(){Test t;
Q14: Which of the following is true?
A)all objects
Q15: Which of the following is true about
Q17: Predict the output?#include <iostream> using namespace std;class
Q18: What happens when delete is used for
Q19: Is it fine to call delete twice
Q20: Which of the followings is/are automatically added
Q21: Output of following program?#include<iostream> using namespace std;
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents