consider following function
f(char *p)
{
if p has allocated the memory previously then
free p;
else
return;
}
I guess You understood the problem.
How do I know that any pointer has allocated the memory?
f(char *p)
{
if p has allocated the memory previously then
free p;
else
return;
}
I guess You understood the problem.
How do I know that any pointer has allocated the memory?
Comment