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

Answer Posted / glibwaresoftsolutions

• 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer and structure in c?

771


What are the __date__ and __time__ preprocessor commands?

774


How can I write functions that take a variable number of arguments?

842


What are header files in c programming?

846


Explain 'bus error'?

766


What is the difference between mpi and openmp?

987


What are the different types of control structures in programming?

877


What are bitwise shift operators in c programming?

827


What is the use of a semicolon (;) at the end of every program statement?

1129


What is the data segment that is followed by c?

826


What is meant by gets in c?

807


What are the applications of c language?

835


What is the significance of scope resolution operator?

1120


Is it acceptable to declare/define a variable in a c header?

875


Why static variable is used in c?

759