Sender: From: jacasey DOT invalid AT bajor DOT its DOT deakin DOT edu DOT au Subject: Re: fflush(stdin); /*doesn't seem to work in dos? */ Newsgroups: comp.os.msdos.djgpp References: <6uhI4.60$ie DOT 11883 AT news DOT deakin DOT edu DOT au> <83r9cdag0m DOT fsf AT mercury DOT st DOT hmc DOT edu> User-Agent: tin/1.5.2-20000206 ("Black Planet") (UNIX) (SunOS/5.7 (sun4u)) Lines: 37 Message-ID: Date: Mon, 10 Apr 2000 22:40:31 GMT NNTP-Posting-Host: 139.132.19.1 X-Trace: news.deakin.edu.au 955406431 139.132.19.1 (Tue, 11 Apr 2000 08:40:31 EST) NNTP-Posting-Date: Tue, 11 Apr 2000 08:40:31 EST Organization: Deakin University, Victoria, Australia To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nate Eldredge wrote: > jacasey DOT invalid AT bajor DOT its DOT deakin DOT edu DOT au writes: >> yeah as the subject says fflush(stdin); doesn't seem to work in dos or >> djggp, any thoughts? > According to ANSI, fflush(stdin) has undefined behavior, so > technically, no matter what happens, DJGPP is still correct. In > practice, it just does nothing (IIRC). > But that doesn't help you. What did you want to accomplish by this? > There is almost certainly a correct way to do it. Okay heres the offending code snippet: there seems to be a loose CR character in there somewhere, the first loop goes fine and then after the second it completely skips my first gets(); btw. fflush(stdin); works quite nicely on unix (sun), I guess its just not completely ansi compliant. void get_job(QUEUE *queue) { int count; ELEMENT job_buffer; for(count=0;count