Here's a code I'm reading from a tutorial, and I'm trying to make my own program while learning from this. I try to compile this, and I get errors:

#include <stdio.h>
#include <stdlib.h>

struct person {
char name [20];
struct person *next;
};
struct person *new;
struct person *head;
head = NULL;
main()
{
new = (person*)malloc (sizeof(struct person));
new->next = head;
head = new;
}


The errors are:

Error c:\tc\test.c 10: Declaration needs type or storage class
Error c:\tc\test.c 10: Type mismatch in redeclaration of 'head'
Error c:\tc\test.c 13: Undefined symbol 'person' in function main
Error c:\tc\test.c 13: Expression syntax in function main
*** 4 errors in Compile ***

Any advice? This code was written by the book I'm reading.