• 7 odgovora
  • 3.877 pregleda
Problem n1! Kopiranje datoteka 01.08.2005. u 16:18 · pre 258 meseci #1
E ovako kupio sam knjigu Programski jezik C :ANSI C.
EH nakon nekog vremena dolazim do dijela .1.5.1 tj Kopoiranje datoteka.

Evo programa tog sto mi malo nije "jasan".

Code:
#inuclude <stdio.h>
        main()
        {
            int c;
            c = getchar();
            while (c != EOF) {
            putchar(c);
            c = getchar () ;
       }
       



Eh problem je ovo u zagradi.(EOF) mozetel mi malo to objasniti oko EOF.Koliko iznosi EOF i ostalo? !

[Ovu poruku je menjao ankone dana 01.08.2005. u 17:21 GMT+1]
Re: Problem n1! Kopiranje datoteka 01.08.2005. u 17:00 · pre 258 meseci #3
Na win -> control+Z
Na lin -> control+D...

[Ovu poruku je menjao rumpl dana 01.08.2005. u 20:41 GMT+1]
Potpis
"The problem with the world is that everyone is a few drinks behind."
-Humphrey Bogart
Re: Problem n1! Kopiranje datoteka 01.08.2005. u 17:37 · pre 258 meseci #5
'\0' na kraju fajla, ali moze neki fajl imati i gomilu '\0' u njemu... tu postaje zanimljivo napisati
funkciju my_line... :)
Potpis
"The problem with the world is that everyone is a few drinks behind."
-Humphrey Bogart
Re: Problem n1! Kopiranje datoteka 01.08.2005. u 17:44 · pre 258 meseci #6
Citat:
End-Of-File Indicator
When this indicator is set, the last reading or writing operation permormed has reached the End of the file associated with the stream. This can be checked with the feof function, and can be reset by calling to clearerr or by any repositioning functions (rewind, fseek and fsetpos).


[Ovu poruku je menjao `and dana 01.08.2005. u 18:45 GMT+1]
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme