/* John Pfeiffer 21nov07 Demo of how to read piped data - 2nd, read data*/
/* usage: pipe-start.c.exe | pipe-end.c.exe */
#include <stdio.h>
int main(int argc, char* argv[])
{
int i=0;
char c, temp[1024];
c = getchar();
printf("\nReceiving...\n");
while( c != EOF )
{
printf("%c",c);
temp[i] = c;
i++;
c = getchar();
}
i++;
temp[i] = '\0';
printf("\nI have been piped\n%s",temp);
return 0;
}