jazykc
2013.3
upoljazykc
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Macros
Pages
prace-s-textovymi-soubory
cat.c
Go to the documentation of this file.
1
12
#include <stdio.h>
13
#include <stdlib.h>
14
15
#ifndef BUFSIZE
16
#define BUFSIZE 1024
17
#endif
18
19
static
char
buffer[BUFSIZE+1];
20
21
int
main (
int
argc,
char
*argv[]) {
22
23
int
i = 1;
24
FILE *fin = stdin;
25
char
*pch;
26
int
rc;
//navratovy kod
27
28
do
{
29
30
while
(1==1) {
31
pch = fgets(buffer, BUFSIZE, fin);
32
if
(pch == NULL) {
//eof nebo chyba
33
break
;
34
}
35
rc = fputs(buffer, stdout);
36
if
(rc == EOF) {
37
perror(
"fputs"
);
38
exit(EXIT_FAILURE);
39
}
40
}
41
42
}
while
(argv[i]);
43
44
exit(EXIT_SUCCESS);
45
46
}
Generated on Sat Dec 7 2013 22:57:26 for jazykc by
1.8.5