Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C++ | new and delete | Question 2

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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 and 3


Answer: (D)

Explanation: See malloc() vs new

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads