Author Topic: turn off line buffering on stdin  (Read 11054 times)

Graeme

  • Senior Community Member
  • Posts: 2748
  • Hero Points: 340
turn off line buffering on stdin
« on: August 01, 2019, 04:15:52 am »
For both GCC / ARM on Linux and Visual Studio on windows, for stdin (or cin), is there any way to find out if a key has been pressed without waiting for <enter> to be pressed  - i..e without line buffering.
i.e. anychar()
returns true or false immediately without blocking and if it returns true then getchar() returns the character without blocking.




Graeme

  • Senior Community Member
  • Posts: 2748
  • Hero Points: 340
Re: turn off line buffering on stdin
« Reply #1 on: August 02, 2019, 03:36:02 am »
Never mind, I figured this out.