0
I know that both functions allocate a memory space in bytes and returns the address of that memory, where calloc
frees this space while in malloc
the release must be made by the function free
. But in code, how these functions work?
0
I know that both functions allocate a memory space in bytes and returns the address of that memory, where calloc
frees this space while in malloc
the release must be made by the function free
. But in code, how these functions work?
Browser other questions tagged c malloc
You are not signed in. Login or sign up in order to post.
calloc()
is equal tomalloc()
but it Zera the memory allocated, has nothing to release. Thefree()
should be used no matter if usedmalloc()
,calloc()
orrealloc()
changing the position of an allocation. See https://answall.com/q/179205/101.– Maniero
Also: https://answall.com/q/353757/101, https://answall.com/q/345055/101, https://answall.com/q/141975/101 and https://answall.com/q/276547/101
– Maniero