How to check if the internal typedef struct of a typedef struct is NULL ?
Posted
by watchloop
on Stack Overflow
See other posts from Stack Overflow
or by watchloop
Published on 2010-04-21T18:02:28Z
Indexed on
2010/04/21
19:03 UTC
Read the original article
Hit count: 209
typedef struct
{
uint32 item1;
uint32 item2;
uint32 item3;
uint32 item4;
<some_other_typedef struct> *table;
} Inner_t;
typedef struct
{
Inner_t tableA;
Inner_t tableB;
} Outer_t;
Outer_t outer_instance =
{
{NULL},
{
0,
1,
2,
3,
table_defined_somewhere_else,
}
};
My question is how to check if tableA is NULL just like the case for outer_instance.
It tried:
if ( tmp->tableA == NULL )
. I get "error: invalid operands to binary =="
© Stack Overflow or respective owner