220k views
5 votes
What is the return type of pointers for functions like malloc() and calloc() in C?

a) int
b) char
c) void *
d) float *

1 Answer

3 votes

Final answer:

The return type of pointers for functions like malloc() and calloc() in C is 'void *'. These functions perform dynamic memory allocation and return a generic void pointer to the allocated memory block.

Step-by-step explanation:

The return type of pointers for functions like malloc() and calloc() in C is c) void *. These functions are used for dynamic memory allocation in C. When malloc() or calloc() is called, they allocate a block of memory and return a pointer of type void * to the beginning of the block. Void pointers are generic pointers that can be converted to any other type of data pointer.

User Amit Prajapati
by
8.6k points