disadvantages of realloc ?
Library:<stdlib.h>
define:void *realloc(void *ptr, size_t size);
it modifies the existing size of block to new size with
copies of existing data.simply it add/delete the memory of
existed pointer based on new size without changing its
contents and it returns the pointer of first location.
possible cases:
1.if size >0,ptr is not null->modify the ptr with new size
and return pointer of 1st location.
2.if size is 0,ptr is not null->it would not change the
size of pointer but delete the existing contents.
3.if size >0,ptr is null->create new ptr with that size and
return that new pointer.
4.if there is not enough space to rellocate ptr,then it
return null pointer with out changing the block of data.
case 2 and 4 are disadvantages,since orignial contents are
getting deleted and also if we trying to use null pointer
then it would crash the program.
| Is This Answer Correct ? | 3 Yes | 0 No |
write a programming in c to find the sum of all elements in an array through function.
Explain what is the advantage of a random access file?
Under what circumstances does a name clash occur?
how to find the binary of a number?
Do character constants represent numerical values?
Is it possible to have a function as a parameter in another function?
What are the types of data types and explain?
Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...
wat is the difference between a definition and declaration? float y;---it looks like a declaration..but it s a definition.how?someone explain
Is javascript written in c?
errors in computer programmes are called
ratio,age,persentage