0 votes
in C Plus Plus by
What are the differences between malloc () and calloc () in C Language?

1 Answer

0 votes
by

Malloc C

2-It initializes the contains of block of memory to zerosMalloc takes one argument, memory

allocated contains garbage values.

It allocates contiguous memory locations. Calloc takes two arguments, memory allocated

contains all zeros, and the memory allocated is not contiguous.

Related questions

0 votes
asked Jan 6, 2021 in C Plus Plus by GeorgeBell
0 votes
asked Mar 10, 2020 in C Plus Plus by rahuljain1
...