I'm writing a function that allows a user to create a singly linked-list I'm getting errors with the function. How can I fix this code?

Code:
struct node *createList(void)
{
	struct node *ptr, *tmp;
	int classList, i, head, n;

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

	if(head == NULL)
	{
	    printf("Unable to locate list.");
	    exit(0);
...