[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: your mail
- To: ido naveh <na_ido(at-nospam)netvision.net.il>
- Subject: Re: your mail
- From: guy keren <choo(at-nospam)actcom.co.il>
- Date: Thu, 20 Sep 2001 02:25:01 +0300 (EET DST)
- cc: <Linux-il(at-nospam)cs.huji.ac.il>
- In-Reply-To: <000801c14148$7d20d900$e071003e@ido>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
On Wed, 19 Sep 2001, ido naveh wrote:
> im doing some beginners C programming on a redhat 7.1.
> when including stdio.h and trying to use the "flushall()"
> function, the gcc will not compile the code.
ofcourse, since there is no 'flushall' function in the C language or the
standard C library. there is a fflush function, to flush a specific stream
(e.g. fflush(stdout) ).
> im getting error for "no reference to flushall()".
> iv`e checked the stdio.h file and theres no flushall() function in it.
> the same thing DOES work in windows 2000.
> how can i flush the buffer after using "scanf()" or "getchar"
> in order to clear it for another "getchar()" ????
what buffer exactly do you wish to flush? why do you find a need to flush
any buffer between different reads? are you refering to the problem of
line-buffered input (i.e. your program sees the input only after the user
presses the 'enter' key)? if this is the case, there are 2 methods to make
this work. there is the clean method, and the dirty method. for the dirty
method, look at
http://www.actcom.com.il/~choo/lupg/project-ideas/vt100-pacman.html -
section '5' shows how to use the dirty method.
if anyone could point to the clean method (the one using tcgetattr and
tcsetattr calls), that'll be good. if not, try to 'man termios' and try
figuring it out from there.
hope this helps,
--
guy
"For world domination - press 1,
or dial 0, and please hold, for the creator." -- nob o. dy
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il