I am writing a function callocin a memory management assignment (I am using C). I have one question: I have written a function mallocand was thinking of using it for calloc, as he says he callocwill take numand sizeand return a block of memory (num * size)that I can use mallocto create, however, he says that I need to initialize all the bytes to 0 , and I'm confused about how to do this in general? If you need more information, ask me :)
So, it mallocwill return the pointer (Void pointer) to the first of the used memory, and I have to go through the bytes, initialize them to zero and return the pointer to this edge of the useful memory.
source
share