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 difference between procedural and declarative language?

639


What does the error message "DGROUP exceeds 64K" mean?

720


writ a program to compare using strcmp VIVA and viva with its output.

1512


What is pointer and structure in c?

558


Why c is called top down?

620






What is sizeof int?

629


When should we use pointers in a c program?

618


What is the purpose of the statement: strcat (S2, S1)?

636


What is an lvalue?

627


What is a ternary operator in c?

646


Tell me is null always defined as 0(zero)?

664


What is C language ?

1520


Why we not create function inside function.

1742


What is a c token and types of c tokens?

581


Can the curly brackets { } be used to enclose a single line of code?

709