Skip to main content
edited tags
Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

How can I handle input in C without halting the main loop?

Source Link
AliTeo
  • 35
  • 1
  • 7

How can I handle input in C?

I want my C program to update the console every second, and it was working fine until I tried to handle input. Now the program halts since it waits an input from the user. How can I do this?

while(true) {
    ShowConsole();  //Show
    Sleep(1000);        //Wait
    scanf("%s",&a)      //Handle Input  
    Update();
    ClearScreen();      //Clear
}