after freeing a pointer in c, will free function initializes that pointer to NULL?
No, it is programmers' duty to assign it with NULL.
it will always initialized to NULL after freeing.
some times it makes it NULL and some times not.
that pointer will not be initialized to NULL, until that memory block is really freed by system.
C doesn't have pass by reference concept strictly speaking. so there is no way for free to assign a pointer with null. free function takes only pointer which it has to free, it will not take the address of the variable which has that pointer. So it is not possible. It is programmers' duty to assign with null after calling free function.
Back To Top