Yes , i havenīt the segmentation problem now!Originally Posted by Salem
but how can i know if all the mem is free??
Yes , i havenīt the segmentation problem now!Originally Posted by Salem
but how can i know if all the mem is free??
Aha!!, but i only need 1 objectOriginally Posted by Salem
> but how can i know if all the mem is free??
Well the number of malloc calls matches the number of free calls. So long as you pass the pointer you got from malloc to free, all will be well (assuming you didn't pass a corrupt pointer, and it hasn't fallen over just yet).
> Aha!!, but i only need 1 object
Today - there's always tomorrow and any other program you may write.
No need for sloppy implementation just because "I only need 1"
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.