So i have two structs in the global section
typedef struct stack_1
{
short ctr;
} stack_1;
typedef struct stack_2
{
struct stack_1 *s1;
} stack_2;
then later in the code i do
struct stack_2 *x;
what is my x initialized to ?? 0 or Null. Thank you in advance.
If your declaration is outside any function or with the
statickeyword (more precisely, has static storage duration), the initial value of x is a null pointer (which may be written either as0or asNULL). If it’s inside a function and not defined asstatic(i.e., has automatic storage duration), its initial value is garbage.