What is the dfference between realloc() and free()?
sushants -5 Light Poster
Recommended Answers
Jump to Postvoid* realloc (void* ptr, size_t size);
Reallocate memory block
Changes the size of the memory block pointed to by ptr.
Jump to PostWhat is the dfference between realloc() and free()?
free() performs a task that is a subset of realloc(). Here's what realloc() does:
realloc(p, n)
: Changes the size of the block pointed to by p and returns p. If the size of that block cannot be changed, allocates a …
All 5 Replies
tinstaafl 1,176 Posting Maven
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
annaharris 0 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.