please help .i have written this programme just to enter data to a linked list.but it isnt working.cant understand where the problem is.how can i make this work and how can i make this programme evev better
#include<stdio.h>
#include<stdlib.h>
#define NULL 0
struct linked{
char data[20];
struct linked *next; //pointer to next node
};
typedef struct linked node;
node *record;
void choice(int ); // function protoypes
void enter(node *);
void delete(node *);
void display(node *);
int main()
{
int n;
node s;
record=&s;
printf("enter choice");
scanf("%d",&n);
choice(n);
getch();
}
void choice(int n)
{
do{
switch(n){
case 1:
record=(node *)malloc(sizeof(node));
enter(record);
break;
default:
printf("try again");
}
}
while(1);
}
void enter(node *first)
{
printf(" enter data");
printf("tupe END if finished");
scanf("%[^\n]",first->data);
if(strcmp(first->data,"END"))
first->next=NULL;
else
first->next=(node *)malloc(sizeof(node));
enter(first->next);
}