1 year ago

#357805

test-img

MASTERSI PL

Why i have to assign NULL to pointer after freeing allocated memory?

My question is why i have to assign NULL to pointer after freeing allocated memory?

free(*ptr);
*ptr = NULL;

I mean situation like this, why it is necesssary?

c

null

free

allocation

0 Answers

Your Answer

Accepted video resources