Hi all.
Incidentally, my initial theory of using...
Code:
if (pointer)
{
printf("The pointer has had memory allocated.\n");
}
isn't reliable at all.
For instance, the following code, when run, claimed that the pointer was initialised.... basically, it's not true... obviously it just pointed to a memory address (which is non zero).
Code:
char* char_ptr;
if ( char_ptr )
{
printf("The char pointer was initialised.\n");
}
else
{
printf("The char pointer was not initialised.\n");
}
I guess we should follow the advice of cwr.
Thanks guys
Eddie