[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

what is the difference between malloc and calloc??

Posted on 2006-06-08
2
Medium Priority
?
711 Views
Last Modified: 2006-11-18
what is the difference between malloc and calloc??
0
Comment
Question by:shilpi84
2 Comments
 
LVL 16

Expert Comment

by:alain34
ID: 16861374
You can find an explanation of malloc and calloc here:
http://en.wikipedia.org/wiki/Malloc
0
 
LVL 11

Accepted Solution

by:
Renato Montenegro Rustici earned 1500 total points
ID: 16861751
malloc: reserves memory using a void pointer. It uses a void pointer cause doesnt matter what kind of data will be on the destination memory space.

calloc: works in the same way, but tries to initialize the memory with zeros, if its possible.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Make the most of your online learning experience.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question