P
Peter Dunker
Hello,
I think I have a newbee question.
If I create a char pointer at the beginning of function and use it only
in a special case:
char *name;
if (a = 1)
name = "Hello";
Now I will check if the name pointer was set,
ist that possible ?
if (name ## is set ##)
strlen(name) -> Error
strcmp(name) -> Error
I know that I can set the pointer to 0.
But is there another solution ?
Check if the pointed memory is allocated ?
Thx
Peter
I think I have a newbee question.
If I create a char pointer at the beginning of function and use it only
in a special case:
char *name;
if (a = 1)
name = "Hello";
Now I will check if the name pointer was set,
ist that possible ?
if (name ## is set ##)
strlen(name) -> Error
strcmp(name) -> Error
I know that I can set the pointer to 0.
But is there another solution ?
Check if the pointed memory is allocated ?
Thx
Peter