Which of the following statements about new and malloc are true? I. 'new' is…

Which of the following statements about new and malloc are true? I. 'new' is an operator while 'malloc' is a function. II. 'new' invokes a constructor, whereas 'malloc' does not invoke a constructor. III. 'malloc' returns a void pointer and needs to be typecast, whereas 'new' returns a pointer of the required type.

  1. A.

    Only I

  2. B.

    Both I and II

  3. C.

    Both II and III

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 729 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…