Hi,
How to check if a pointer is allocated or not?
I do "if(p == NULL)". This assumes that the developer did "p = NULL;"
But if he didn't do that, how can I know if the pointer is allocated or not?
Example :
Int *p;
If(p == NULL)
Printf("P = NULL\n");
Else
Memset(p, 0, sizeof(int));
I'd like to know if the pointer is allocated.
Thanks