getchar and putchar, example
#include <stdio.h>
main()
{
int c;
while( (c=getchar())
!= EOF)
putchar(c);
}
How to use this program?
Use it to type a file like UNIX cat command by
a.out < file
Use it to copy files by
a.out < file1 > file2
This is program
pg139.c
Previous slide
Next slide
Back to first slide
View graphic version