/******************************
*	stream_3.c
*	19.03.2002
******************************/

#include <stdio.h>
#include <string.h>

int main(void)
{
 FILE *soubor;
 int i;
 char *s, *jmeno = "soubor1.txt";
 if ((soubor = fopen(jmeno, "wt")) == NULL)
   return 1; 
 s = "Toto je textovy soubor vytvoreny v jazyce C.\n";
 fputs(s, soubor);
 for (i = 0; i<10; i++)
   {
    fprintf(soubor, "%5d", i);
   } 
 fputs("\n", soubor);
 s = "Jeste pridat posledni radek na konec.\n";
 fputs(s, soubor);
 if (fclose(soubor) == EOF)
   return 1; 
 return 0;
}