/* priklad pr8_5.c citanie po slovach */
#include "stdio.h"
void main(void)
{
FILE *fp;
char oneword[100];
char c;
fp = fopen("S.TXT","r");
if (fp == NULL) printf("File S.TXT doesn't exist\n");
else
{
do
{
c = fscanf(fp,"%s",oneword); /* get one word from the file */
printf("%s\n",oneword); /* display it on the monitor */
} while (c != EOF); /* repeat until EOF (end of file) */
}
fclose(fp);
}