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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how can use subset in c program and give more example

1618


What is variable and explain rules to declare variable in c?

694


What are the types of type qualifiers in c?

771


How do I use strcmp?

766


Explain how can a program be made to print the line number where an error occurs?

838






What is a pointer in c?

817


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1712


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

771


what are bit fields in c?

1044


What do you mean by keywords in c?

786


Explain is it better to bitshift a value than to multiply by 2?

848


What is the use of volatile?

763


What is the difference between arrays and pointers?

769


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

803


Difference between strcpy() and memcpy() function?

797