What is the difference between malloc() and realloc()?



What is the difference between malloc() and realloc()?..

Answer / nashiinformaticssolutions

• malloc(): Allocates memory.
• realloc(): Resizes an already allocated memory block, preserving existing data if possible.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How can I find out how much free space is available on disk?

0 Answers  


what is the flow of execution in cprogram? ex:printf();,scanf();

2 Answers  


When should volatile modifier be used?

0 Answers  


what is the significance of static storage class specifier?

0 Answers  


In how much time you will write this c program? Prime nos from 1 to 1000

2 Answers   TCS,






is c language is a object oreinted language?

5 Answers   TCS,


ratio,age,persentage

0 Answers  


What is ambagious result in C? explain with an example.

0 Answers   Infosys,


void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..

1 Answers  


Is multithreading possible in c?

0 Answers  


When is a void pointer used?

0 Answers  


What is #include stdlib h?

0 Answers  


Categories