What is the difference between realloc() and free()
Answer Posted / nitin
The free subroutine frees a block of memory previously
allocated by the malloc subroutine. Undefined results occur if
the Pointer parameter is not a valid pointer. If the Pointer
parameter is a null value, no action will occur. The realloc
subroutine changes the size of the block of memory pointed to
by the Pointer parameter to the number of bytes specified by
the Size parameter and returns a new pointer to the block. The
pointer specified by the Pointer parameter must have been
created with the malloc, calloc, or realloc subroutines and
not been deallocated with the free or realloc subroutines.
Undefined results occur if the Pointer parameter is not a
valid pointer.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
can we have joblib in a proc ?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What does 3 periods mean in texting?
Where define directive used?
How many loops are there in c?
What is the use of a static variable in c?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
How do you determine a file’s attributes?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Explain what are the different file extensions involved when programming in c?
how do you programme Carrier Sense Multiple Access
Differentiate fundamental data types and derived data types in C.
What are the types of type qualifiers in c?
Can two or more operators such as and be combined in a single line of program code?