scanf is obviously not suitable for this. This is to determine whether the input is completed based on the user's input and press Enter. The two you mentioned are in GUI mode. I suggest you look at the Windows API or some packaged APIs, so Hook each input of the user. For example, if the user expects to input "C++ programming", the user will input "C", "+", "+", "program", and "program" in sequence. The characters you intercepted Then put it in the background for processing, and then put it in the display interface for display.
This may help you
http://stackoverflow.com/questions/421860/capture-characters-from-standard-input-without-waiting-for-enter-to-be-pressed
PS: If you encounter technical problems, try using Google and stackoverflow, :)
scanf is obviously not suitable for this. This is to determine whether the input is completed based on the user's input and press Enter. The two you mentioned are in GUI mode. I suggest you look at the Windows API or some packaged APIs, so Hook each input of the user. For example, if the user expects to input "C++ programming", the user will input "C", "+", "+", "program", and "program" in sequence. The characters you intercepted Then put it in the background for processing, and then put it in the display interface for display.