Answer Posted / praviss
An existing block of memory which was allocated by malloc() subroutine, will be freed by free() subroutine. In case , an invalid pointer parameter is passed, unexpected results will occur. If the parameter is a null pointer, then no action will occur.
Where as the realloc() subroutine allows the developer to change the block size of the memory which was pointed to by the pointer parameter, to a specified bytes size through size parameter and a new pointer to the block is returned. The pointer parameter specified must have been created by using malloc(),calloc() or realloc() sub routines and should not deallocated with realloc() or free() subroutines. If the pointer parameter is a null pointer, then no action will occur.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How Do you Code Composition and Aggregation in C++ ?
What is coupling in oops?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is the difference between procedural programming and oops?
What is the highest level of cohesion?
What are the 4 main oop principles?
How to hide the base class functionality in Inheritance?
Why do while loop is used?
What is this pointer in oop?
What is oops?what is its use in software engineering?
Where is pseudocode used?
What is the real time example of encapsulation?
What are the three parts of a simple empty class?
What is difference between data abstraction and encapsulation?
What does no cap mean?