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

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
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: 2793
  • Hero Points: 347
Re: turn off line buffering on stdin
« Reply #1 on: August 02, 2019, 03:36:02 AM »
Never mind, I figured this out.