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
Which is best linux os?
Tell us two differences between new () and malloc ()?
What is the use of header files?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is data type long in c?
What are the types of functions in c?
is it possible to create your own header files?
List the difference between a "copy constructor" and a "assignment operator"?
Which header file is essential for using strcmp function?
Is that possible to add pointers to each other?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
How do you write a program which produces its own source code as output?
What are keywords in c with examples?
What is a ternary operator in c?