home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18457 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.7 KB  |  54 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!news.mentorg.com!sun_hybrid!stuartj
  3. From: stuartj@esg.mentor.com (Stuart John)
  4. Subject: Re: Getting input from the keyboard
  5. Sender: news@news.mentorg.com (News User)
  6. Message-ID: <1992Dec16.112620.19555@news.mentorg.com>
  7. Date: Wed, 16 Dec 1992 11:26:20 GMT
  8. Reply-To: stuartj@esg.mentor.com
  9. References: <1992Dec14.212611.12032@cs.mun.ca> <pal.724501355@regent.e-technik.tu-muenchen.de>
  10. Nntp-Posting-Host: sun_hybrid.mentorg.com
  11. Organization: Mentor Graphics Corporation
  12. Keywords: 
  13. Followup-To: 
  14. Lines: 38
  15.  
  16. In article <pal.724501355@regent.e-technik.tu-muenchen.de>, pal@regent.e-technik.tu-muenchen.dbp.de (Peter Loibl) writes:
  17. |> paulk@garfield.cs.mun.ca (Paul E. King) writes:
  18. |> 
  19. |> [stuff deleted]
  20. |> 
  21. |> >I want to know how C  can obtain input from the keyboard directly,
  22. |> >without my having to type a carriage return. I know that the vi editor 
  23. |> >works on this principle (that is what I am using now). 
  24. |> 
  25. |> [stuff deleted]
  26. |> 
  27. |> >I am using a UNIX-based System V Berekley C compiler.
  28. |> 
  29. |> [stuff deleted]
  30. |> 
  31. |> Hi!
  32. |> 
  33. |> getc(FILE *stream) reads one single character from a certain stream.
  34. |> Streams are: open files, stdin and stderr (stdout is also one, but
  35. |> this makes little sense here).
  36. |> 
  37. |> You should try getc(stdin).
  38. |> 
  39. |> More details are on the manual pages.
  40. |> 
  41. |> Peter Loibl
  42. |> pal@regent.e-technik.tu-muenchen.de
  43.  
  44. I was trying to do this at uni last year, and in the end i had to use
  45. a couple of curses structures to turn 'cooked' mode into 'raw' mode
  46. on the terminal, so it didn't buffer input lines.
  47. -- 
  48.   _
  49.  ( `/_
  50. (_)(_(/                  stuartj@esg.mentor.com
  51. Mentor Graphics Corporation, BRACKNELL, England
  52.  
  53. #include<std.disclaimer>
  54.