#include #define MAXLEN 256 int main() { int n; char buf[MAXLEN]; while((n = read(0,buf,sizeof(buf))) != 0){ printf(\"n: %d:\",n); wri
Use fwrite (streams version) rather than write.
Note that, while is associated with file number 1, it isn't the same thing.