The Wayback Machine - https://web.archive.org/web/20210204130343/https://www.geeksforgeeks.org/c-dynamic-memory-allocation-question-5/
Skip to content
Related Articles

Related Articles

C | Dynamic Memory Allocation | Question 5
  • Difficulty Level : Basic
  • Last Updated : 31 Jul, 2013

What is the return type of malloc() or calloc()
(A) void *
(B) Pointer of allocated memory type
(C) void **
(D) int *


Answer: (A)

Explanation: malloc() and calloc() return void *.

We may get warning in C if we don’t type cast the return type to appropriate pointer.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :