I have been trying to write a program that accepts user input as they type in. I need these input strings to do certain task by calling an external executable as soon as the word is separated by space. I tried using scanf()
. Though the words can be read, the executable is executed only after ENTER is pressed. i.e,instead of word by word, the program is executing the desired call line by line only. Is there anyway to make the program to execute the call word by word? That is, when the SPACE is pressed, could the call be done?
If not possible in C, is it possible in any other programming language like python, c++ etc?