+ 1

How do i get input from user while outputting?

For exapmle: printing odd number continuously 1 to 49 while printing output, on user input the prgram should switch from odd to even? (before the end of program).

9th Apr 2018, 5:44 PM
Zohaib 👑
Zohaib 👑 - avatar
1 Respuesta
+ 1
When I've coded things like this before, I've created a callback for keyboard events. This will then switch the numbers being printed flag, from even to odd, or vice versa. User input is awful by default in C and C++. It's only good if you do some non-standard / operating system specific coding for capturing keyboard events properly!
9th Apr 2018, 10:54 PM
Emma