This is a discussion on 1. What is the difference between "calloc(...)" and "malloc(...)"? within the C and C++ Programming forums, part of the Software Development category; What is the difference between "calloc(...)" and "malloc(...)"?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| What is the difference between "calloc(...)" and "malloc(...)"?
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| Sponsored Links |
| |||
| 1. calloc(...) allocates a block of memory for an array of elements of a certain size. By default the block is initialized to 0. The total number of memory allocated will be (number_of_elements * size). malloc(...) takes in only a single argument which is the memory required in bytes. malloc(...) allocated bytes of memory and not blocks of memory like calloc(...). 2. malloc(...) allocates memory blocks and returns a void pointer to the allocated space, or NULL if there is insufficient memory available. calloc(...) allocates an array in memory with elements initialized to 0 and returns a pointer to the allocated space. calloc(...) calls malloc(...) in order to use the C++ _set_new_mode function to set the new handler mode. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I keep getting "Data Missing" when I click the "back" button in my browser. How can I | oxygen | HTML, CSS and Javascript Coding Techniques | 1 | 07-28-2007 01:12 AM |
| What is the difference between "calloc" and "malloc"? | Sabari | C and C++ Programming | 1 | 07-23-2007 06:08 AM |
| Why do I get "HTTP 500" error(or "(DLL)initialization routine failed")in my browser? | kingmaker | ASP and ASP.NET Programming | 1 | 07-20-2007 04:38 AM |
| Difference between "APPLET" and "APPLICATION" | prasath | Java Programming | 1 | 07-17-2007 07:51 AM |
| Difference between a "assignment operator" and a "copy constructor"? | vigneshgets | C and C++ Programming | 2 | 07-12-2007 05:30 AM |