i keep getting this error
next' : is not a member of 'book'
here is the code any help would be great!!!!
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct book
{
int code;
char title[20];
char author[20];
int pages;
}*head,*work,*next;
main()
{
int code;
char title;
char author;
int pages;
int ans;
struct book*head;*work;*next;
head=(struct book*)malloc(sizeof(struct book));
work=head;
printf("Enter code:");
scanf("%d",&code);
printf("Enter Title:");
scanf("%c", &title);
printf("Enter Author:");
scanf("%c", &author);
printf("Enter Number of Pages:");
scanf("%d",&pages);
printf("Do you wnat to add another book?:1=yes/2=no");
scanf("%s",&ans);
while (ans!=1)
{
work->next=NULL;
return 0;
}
work->next=(struct book*)malloc(sizeof(struct book));
work=work->next;
}