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:
22 comments Page 2 of 3.
C budda reddy said:
1 decade ago
Memory is allocated for the functions and its variables.
Dealloc is delete the after complete operations memory resource is deallocated.
Dealloc is delete the after complete operations memory resource is deallocated.
Abhishek Rai Sharma said:
2 decades ago
What is the difference between malloc() and calloc()?
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()?
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
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.
Mimi said:
1 decade ago
What is the differences between malloc and calloc?
Vishak said:
2 decades ago
calloc expansion?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers