1

I cant use scanf() because to receive integer input you need to press ENTER (when you are running the program).

happymancer
  • 45
  • 1
  • 10
  • I need answer really fast so please help me with that thing – happymancer Dec 27 '16 at 12:09
  • BTW i need to get from the users 4 digits in the same row like 4563 end then the program should continue without waiting for the user to press enter (if someone got my question wrong i hope that this comment will help) – happymancer Dec 27 '16 at 13:41
  • thx guys but finally i thought about using getch with the ascii table XD – happymancer Dec 27 '16 at 15:08

2 Answers2

0

Use curses library and use getch function to read a key without pressing enter. This works on linux and i think you can also use it on windows

baliman
  • 588
  • 2
  • 8
  • 27
0

If you are in Windows, then use getch() from conio.h If you are in Unix/Linux.. you will probably need some terminal/tty adjustments. Check here:

What is Equivalent to getch() & getche() in Linux?

Community
  • 1
  • 1
zsram
  • 366
  • 2
  • 7