C Programming - Memory Allocation - Discussion
Discussion Forum : Memory Allocation - General Questions (Q.No. 4)
4.
Specify the 2 library functions to dynamically allocate memory?
Discussion:
21 comments Page 2 of 3.
Soundarya kumari .B said:
1 decade ago
malloc(): Allocates the specified number of bytes
calloc(): Allocates the specified number of bytes and initializes them to zero these are present in the standard library.
calloc(): Allocates the specified number of bytes and initializes them to zero these are present in the standard library.
Asmita said:
1 decade ago
What is alloc() , memalloc() and faralloc() ?
Suvathi said:
1 decade ago
What is a malloc, memalloc and alloc ?
Thangaraj said:
1 decade ago
What is mean by memalloc() and faralloc()?
Riend said:
1 decade ago
malloc will return an uninitialized chunk of memory for you to use.
calloc ( clear alloc ) will attempt to initialize that chunk of memory to all bits zero.
calloc ( clear alloc ) will attempt to initialize that chunk of memory to all bits zero.
Yuvapriya said:
1 decade ago
malloc() - allocating a block of memory dynamically and sets all the bits to zero.
Eg:
ptr = (cast-type*)malloc(byte_size);
calloc() - allocating multiple block of memory dynamically.
Eg:
ptr=(cast-type*)calloc(n, ele_size);
n-->no of blocks
Eg:
ptr = (cast-type*)malloc(byte_size);
calloc() - allocating multiple block of memory dynamically.
Eg:
ptr=(cast-type*)calloc(n, ele_size);
n-->no of blocks
Mimi said:
1 decade ago
What is the differences between malloc and calloc?
Vishak said:
2 decades ago
calloc expansion?
Tulasi said:
2 decades ago
wat is ment by faralloc where it is used?
Bhargavi said:
2 decades ago
The malloc() is used to assign the single block of memory at run time and the calloc() is used to assign the multiple blocks of memory at runtime.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers