[vox-tech] a better scanf?? (C-programming question)

Andy Campbell vox-tech@lists.lugod.org
Thu, 17 Apr 2003 11:42:09 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C304D6.60EFB320
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hello all,
 
Does anyone know of a better input mechanism from stdin than scanf?? I
need the functionality of scanf, without stopping the program flow. In
other words, is there a function that will store any keyboard info into
a buffer, and then continue with the program until next time the loop
executes and it sees what (if anything) has been put into the buffer,
and stores the buffer contents once the carriage return is input??
 
I basically need a scanf that doesn't halt the program?? The only thing
I have found is "bioskey" but I think that that is only in a dos
environment??
 
Does anyone know how to do this in linux??
 
Thanks
Andy

------=_NextPart_000_0001_01C304D6.60EFB320
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D375243218-17042003>Hello=20
all,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D375243218-17042003>Does =
anyone know of=20
a better input mechanism from stdin than scanf?? I need the =
functionality of=20
scanf, without stopping the program flow. In other words, is there a =
function=20
that will store any keyboard info into a buffer, and then continue with =
the=20
program until next time the loop executes and it sees what (if anything) =
has=20
been put into the buffer, and&nbsp;stores the buffer =
contents&nbsp;once&nbsp;the=20
carriage return is input??</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D375243218-17042003>I&nbsp;basically=20
need a scanf that doesn't halt the program?? The only thing I have found =
is=20
"bioskey" but I think that that is only in a dos=20
environment??</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D375243218-17042003>Does =
anyone know how=20
to do this in linux??</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D375243218-17042003>Andy</SPAN></FONT></DIV></BODY></HTML>

------=_NextPart_000_0001_01C304D6.60EFB320--