Freeing a pointer in c: Which of the given options are wrong about a pointer?
i. Freeing a pointer more than once.
ii. Freeing a pointer, which has not be allocated.
iii. freeing a null pointer.
iv. all of the above are wrong, even though freeing a null pointer won't cause problem in recent editions, but still it is also wrong in old machines.
We have to take below measures when freeing a pointer in c.
1. We should not free a pointer more than once.
2. We should not free a pointer, which has not be allocated.
3. We should not free a null pointer. (Not portable)
Back To Top