0

A linked list defined as:

typedef struct linkedList_struct {
    short unsigned int num;
    struct linkedList_struct *next ;
} linkedList;

I'm trying to print out the num value of **head when **head is passed to the function

int function(linkedList **head) 
{
   printf("%X\n, head->num);  // I get error here: error: member reference base type 'linkedList*' (aka 'struct linkedList_struct *') is not a structure or union
}

How do I dereference this double pointer to a linked list node so that I can print out head->num value?

halfer
  • 19,824
  • 17
  • 99
  • 186
Katie Melosto
  • 1,047
  • 2
  • 14
  • 35

0 Answers0