jim@ISM780B.UUCP (03/16/85)
>#include <stdio.h> > >main() >{ > char buff[64]; > > setbuf(stdout,buff); > > fprintf(stdout,"This is a message\n"); > fprintf(stderr,"And this is an error\n"); >} > >He dutifully compiled it with 'cc -o dork dork.c', and executed >the resultant file. Much to my surprise, this resulted in: > >And this is an error >This~^R^G^Z^A~x^Rage Quite expectable if you don't follow the documentation, which states that the argument to setbuf is a char buf[BUFSIZ]. 64 is < BUFSIZ. -- Jim Balter, INTERACTIVE Systems (ima!jim)