the dynamic memory. It just deallocates its pointer. Then why is it incorrectly spoken that "dynamic allocation is better than static as memory is not allocated at compile time and it can anytime be "freed" using free()"?
Deallocating lets another allocation overwrite that chunk of memory. You can set the whole thing to zero before deallocating but why would you waste time doing that
Except as a security measure for the ultra paranoid maybe?? Idk
😑 So basically all along this time, free(ptr) (where ptr is int pointer say) was a technique to just be able to reuse a pointer variable?
I meant to say now don't use ptr for pointing "this" memory but now use it to point "that" memory in the heap
You have a flawed understanding of how allocation works in C
Обсуждают сегодня