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

Ryan vox-tech@lists.lugod.org
Thu, 17 Apr 2003 12:24:54 -0700


This is a multi-part message in MIME format.

--Boundary_(ID_6BqgAu+zR+HI1tp9xECbjQ)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

Messagethere is a getch() you can use from ncurses, otherwise
See if this link helps

http://www.c-for-dummies.com/lessons/linux/04/


  ----- Original Message ----- 
  From: Andy Campbell 
  To: vox-tech@lists.lugod.org 
  Sent: Thursday, April 17, 2003 11:42 AM
  Subject: [vox-tech] a better scanf?? (C-programming question)


  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

--Boundary_(ID_6BqgAu+zR+HI1tp9xECbjQ)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2723.2500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>there is a getch() you can use from ncurses, 
otherwise</FONT></DIV>
<DIV><FONT face=Arial size=2>See if this link helps</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><A 
href="http://www.c-for-dummies.com/lessons/linux/04/">http://www.c-for-dummies.com/lessons/linux/04/</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=atcampbell@ucdavis.edu href="mailto:atcampbell@ucdavis.edu">Andy 
  Campbell</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=vox-tech@lists.lugod.org 
  href="mailto:vox-tech@lists.lugod.org">vox-tech@lists.lugod.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, April 17, 2003 11:42 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [vox-tech] a better scanf?? 
  (C-programming question)</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2><SPAN class=375243218-17042003>Hello 
  all,</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><SPAN class=375243218-17042003>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&nbsp;stores the buffer 
  contents&nbsp;once&nbsp;the carriage return is input??</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><SPAN class=375243218-17042003>I&nbsp;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??</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><SPAN class=375243218-17042003>Does anyone know 
  how to do this in linux??</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003>Thanks</SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2><SPAN 
  class=375243218-17042003>Andy</SPAN></FONT></DIV></BLOCKQUOTE></BODY></HTML>

--Boundary_(ID_6BqgAu+zR+HI1tp9xECbjQ)--