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
What is the difference between call by value and call by reference in c?
Why doesnt the call scanf work?
What is the return type of sizeof?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What are valid signatures for the Main function?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is define directive?
What is difference between scanf and gets?
What is static and volatile in c?
What are different types of variables in c?
Can you mix old-style and new-style function syntax?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What does nil mean in c?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory