05-14-2007
42,
0
Join Date: Apr 2007
Last Activity: 19 June 2007, 1:28 AM EDT
Posts: 42
Thanks Given: 0
Thanked 0 Times in 0 Posts
c programming language
Can someone enligten me on what below program does?
I understand getchar and putchar.. but what is this program suppose to do?
I try to put printf on it, but it shows nothing..
can someone explain to me what this program is suppose to do?
It is reading something and assigning to c?
so, if I do, ./a.out filename , will it assign entire filename's content into c?
#include <stdio.h>
/* copy input to output; 1st version */
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}