what are the various memory handling mechanisms in C ?

Answer Posted / priya

The malloc function allows the programmer to create a block of memory of a given size:

malloc ( long integer lBlockSize ) returns void *

If we decide, during the execution of the program, that we might need to expand, or contract this memory block, we can use the realloc function:

realloc ( void * pBlock, long int lNewBlockSize ) returns void *

When the memory block is no longer used, then it must be returned back to the operating system, by calling the free function:

free ( void * pBlock )

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the importance of c in your views?

811


what is bit rate & baud rate? plz give wave forms

1723


how to make a scientific calculater ?

1800


What is wrong with this statement? Myname = 'robin';

1054


What are the different types of control structures?

803


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1665


What are the various types of control structures in programming?

809


Why we use break in c?

755


What are the different types of control structures in programming?

889


How do you use a pointer to a function?

855


What is #include in c?

789


What is define c?

769


What is the difference between procedural and declarative language?

894


Describe the order of precedence with regards to operators in C.

842


main() { printf("hello"); fork(); }

948