Take the 2-minute tour ×  This is code for a linked list in the
C programming language.  #include <stdio.h>    /* For printf */
#include <stdlib.h>   /* For malloc */  typedef struct node {
int data;     struct node *next; /* Pointer to next element in
list */  LLIST *list_add(LLIST **p, int i); void
list_remove(LLIST **p); LLIST **list_search(LLIST **n, int i);
void list_print(LLIST *n);  The code is not completed, but I
think it's enough for my question. Here at the end of struct
node "LLIST" is used, and it's also used as a return type in the
prototyping of the function list_add. What is going on?
share|improve this question add comment  5 Answers  up vote 5
down vote accepted  typedef creates a new "type" in your
program, so the return value and types of parameters of those
functions are just your struct. It is just shorthand for using
struct node for the type.  If you were to create a new node, you
could do it like this (using the type):  LLIST *node =
malloc(sizeof(LLIST)); node->data = 4; node->ne