answersLogoWhite

0

The calloc() Function calloc will allocate space in the memory as well as initialise it to a particular value. Holds 2 arguments, data type and number of datas (n) allocates memory block equivalent to n * data type clears alloted memory with 0 calloc allocates sizeof(datatype) bytes to the no of elements in the file, where by the user can specify the file size as the second arguement. char *calloc(sizeof(datatype), num of elements) calloc() is more efficient as memory is allocated in 1 cycle so fewer clock cycles, more faster executiop.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What if happen when you allocate memory by using malloc or calloc when the momory is not available contigiously?

malloc/calloc/realloc will return NULL


Which of libraries calloc belongs?

malloc()


In which way calloc is better than malloc?

What calloc does is: void *calloc (size_t s1, size_t s2) { size_t s= s1*s2; void *p= malloc (s); if (p && s) memset (p, 0, s); return p; }


Which function should be used to free the memory allocated by calloc?

Use the free function to release memory that was previously allocated by malloc, calloc or realloc.


71 Which function should be used to free the memory allocated by calloc?

free() is a function used to free the memory allocated dynamically ,by both malloc and calloc functions. free(ptr): ptr is a pointer to a memory block which has already been creeated by malloc or calloc.


What is the difference between Malloc and calloc in C and JAVA?

In C, malloc is used to reserve a predetermined size of memory. void * malloc ( size_t size ); calloc is used to reserve a chunk of memory large enough to store num elements, each of a predetermined size. void * calloc ( size_t num, size_t size ); To create a char array of size 10 you can do it in one of two ways: char* mChars = malloc( 10 * sizeof(char) ); char* cChars = calloc( 10, sizeof(char) ); There is no concept of malloc or calloc in Java.


Contiguous memory allocation program in Linux?

malloc or calloc


What is the return type of calloc function?

the return type is void


What is the calloc function in C programming?

calloc is memory allocation function that is normally used for requesting memory space at run time 4 storing data types such as arrays and structures. calloc allocates multiple blocks of storage, each of the same size and then sets all bytes to zero, and then returns a pointer to the memory.


Could calloc assign memory for object?

yes,it will create memory


What is the type of the pointer returned by calloc function?

'void *' (or 'char *' if your system is very old)


What is the operator is used to allocate the memory in c plus plus?

calloc operator,malloc operator