Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Programming Languages > Cpp

Cpp C++ Interview Questions, Learn by sharing C++ Interview Questions asked in various Companies, Get Career advices, Interview Procedures from C++ experts, Post asked C++ Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2008, 05:41 AM
Senior Member
 
Join Date: Feb 2008
Posts: 1,210
Default What is the difference between calloc and

What is the difference between calloc and malloc?
Reply With Quote
  #2 (permalink)  
Old 04-30-2008, 06:32 AM
Junior Member
 
Join Date: Apr 2008
Posts: 3
Default

Quote:
Originally Posted by Margaret View Post
What is the difference between calloc and malloc?
Basically there are few differences btw them,one is the number of parameters we give.For calloc we will give the size of the variable or data to be created.
when we use Calloc(),defaultly your memory is initialized to zeros
One more difference is their return type..

Please check for Memory management in C++
Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 06:12 AM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Default

another diff. my friend is malloc() is more faster dan calloc b'coz calloc takes 2 args & initialisation.so more time req. for calloc to execute.
Reply With Quote
  #4 (permalink)  
Old 07-09-2008, 06:19 AM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Default

another diff. my friend is malloc() is more faster dan calloc b'coz calloc takes 2 args & initialisation.definitely some more code will be written for calloc.that's why calloc takes more time to be executed..
Reply With Quote
Reply

Tags
c++, programming language, software

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On