11-08-2017, 02:13 AM | #1 |
Registered User
Join Date: Nov 2017
Location: USA
Posts: 75
|
C language
What is the difference between malloc() and calloc()?
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
11-08-2017, 04:57 AM | #2 |
Registered User
Join Date: Nov 2017
Posts: 463
|
Basically there is no difference between the two besides calloc() zero-initializes the buffer, while malloc() leaves the memory uninitialized.
__________________
█ Get your email validated by our To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. █ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. @ ZeroBounce |
11-14-2017, 06:47 AM | #3 |
Registered User
Join Date: Aug 2013
Posts: 79
|
hi, thevyakar
There are two major differences between malloc and calloc in C programming language: first, in the number of arguments. The malloc() takes a single argument, while calloc() takess two. Second, malloc() does not initialize the memory allocated, while calloc() initializes the allocated memory to ZERO.
__________________
"Powerfull state of the art DELL servers!" To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. - Ultimate Windows VPS hosting | √ Dedicated hardware √ MS Hyper-V technology √ Premium bandwidth providers To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. - √ Chat support √ Full 24/7 help desk support √ Email support |
11-17-2017, 03:02 AM | #4 |
Registered User
Join Date: Nov 2017
Location: USA
Posts: 75
|
Thank you all for your answers
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How perl language is differ from other programming language. ? | Dubey675 | Cgi-perl | 0 | 10-21-2016 02:08 AM |
A programming language that uses a visual representation | thiennhientuoid | HTML / DHTML | 0 | 06-24-2016 12:24 AM |
Language Learning Development Software | Aadolf | General Discussion | 0 | 05-09-2016 03:00 AM |
French Language. | eigeehte | Post your ad here | 2 | 01-11-2012 05:37 AM |