я не могу понять, как читать строки (слова) из входного файла в связанный список

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


struct node
{
  char *data;
  struct node *next;
};


void insertNode(struct node**, char *);
void printList(struct node*);


int main()
{
  struct node *head = NULL;
  FILE *fptr;
  char file_name[20];
  char str[1000];
  int numOfChar;


  printf("Enter the name of the file: ");
  scanf("%s",file_name);


  printf("Enter the number of characters per line: ");
  scanf("%d",&numOfChar);


  fptr=fopen(file_name,"r");
    char tokens[100];
  while(fgets(str, sizeof(str), fptr) != NULL)
  {

    while (sscanf(str, "%s", tokens) != EOF)
    {

    }


  }


  fclose(fptr);
  printList(head);


  return 0;
}


void insertNode(struct node** nodeHead, char *data)
{
    struct node* new_node = (struct node*) malloc(sizeof(struct node));
    struct node *last = *nodeHead;
    char *str;


    str= (char *)malloc(60*sizeof(char));
    strcpy(str, data);


    new_node->data  = str;
    new_node->next = NULL;


    if (*nodeHead == NULL)
    {
       *nodeHead = new_node;
       return;
    }


    while (last->next != NULL)
    {
        last = last->next;
    }


    last->next = new_node;
}

Моя программа должна читать каждое слово в связанный список, но я не могу понять, как извлечь каждое слово / строку из входного файла. Входной файл представляет собой текстовый файл ASCII. Какие-либо предложения? Спасибо за вашу помощь.

void printList(struct node* node)
{
    while(node != NULL)
    {
        printf(" %s ", node->data);
        node = node->next;
    }
}

Ответы на вопрос(2)

Ваш ответ на вопрос