how to correct illegal seek error fo my code.

in my programm i m just trying to store the information using linklist. but when i m trying to display(using user defined display)  it i m getting
illegal seek error. please modify the code to correct  the error as soon as possible.

C code is as follows.
struct emp
      int info;
      char name[20];
      char add[30];
      int sal;
      struct emp *next;
typedef struct emp node;
void append (node *);
void display(node *);
node *start;
       int n,i;
       start=(node *)malloc(sizeof(node*));
      // printf("\nSTART : %d",start);

void append(node *record)

      char naam[20];
      //printf("\n RECORD %d",record);
      //printf("\n RECORD->NEXT : %d",record->next);
      printf("\n Enter the element(type 0 when finished):");
      printf("\n Enter the name :");
      printf("\nEnter the address:");
      printf("\nEnter Salary:");
      record->next = (node *)malloc (sizeof(node *));




void display(node *record)


        //      printf("\n RECORD->NEXT : %d",record->next);
            printf("\n INFO IS : %d",record->info);
            printf("\n Name    : %s",record->name);
            printf("\n Address : %s",record->add);
            printf("\n Salary  : %d",record->sal);



Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

sunnycoderConnect With a Mentor Commented:
>start=(node *)malloc(sizeof(node*));

you allocate memory for a single node * and try to store a node in it !!!
this should be
start=(node *)malloc(sizeof(node));

>record->next = (node *)malloc (sizeof(node *));

>    if(record->info==0)
>              record->next=NULL;

will cause a memory leak !!! ... redefine it to

    else {
              record->next = (node *)malloc (sizeof(node *));

>void display(node *record)

>    if(record->next!=NULL)
should be
void display(node *record)


also, this will be a better place to ask such questions
All Courses

From novice to tech pro — start learning today.