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

Graeme

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