consider this definition:
Code:
#define chnull (char *)0
typedef struct
{
int month,day,year;
}DATE;
typedef struct Key KEY;
typedef struct Key* KEYS;
struct Key
{
char *sender;
char *addressee;
char *regarding;
DATE date;
int id;
char *fname;
KEYS next;
};
if I set any of the char strings to chnull...
Code:
...inside some function...
//declare stuff
KEY temp;
temp.fname=(char*)malloc(sizeof(20));
temp.fname=chnull;
I cannot successfully test for a null value by doing
Code:
if( ! temp.fname )
nor by
if( temp.fname==chnull )
but I can test for a good value
So in this case, what is the proper way to test that
temp.fname = chnull so that the test will evaluate to true?
Thanks in advance,
Mike