/* priklad pr8_3.c  citanie po znakoch   */
#include "stdio.h"

void main(void)
{
  FILE *fp;
  char c;

  fp = fopen("S.TXT","r");
  if (fp == NULL) printf("File S.TXT doesn't exist\n");
  else
  {
    do
    {
      c = getc(fp);  /* get one character from the file */
      putchar(c);    /* display it on the monitor    */
    } while (c != EOF);  /* repeat until EOF (end of file) */
  }
  fclose(fp);
}