What does the following code in Morse Code Arduino mean?
What does the following code in Morse Code Arduino mean?


Step by step:

  struct node *root, *currentNode;


Pointer variables root and currentNode. Pointers to struct node.

  root = (struct node*)malloc(sizeof(struct node));


Allocate memory for a struct node and assign root pointer.

  root-&gt;value = '\0';
  root-&gt;next = 0;


Assign struct node members using the root pointer. Assign value member to character 0. Assign next to zero, NULL, i.e. often marks end of list.

  currentNode = root;


Last assign currentNode to point to the save value as root, i.e. the allocated struct node. 

Next question?