I was wondering if it is easy to direct output in a scenario where the program gets user input from stdin and instead of outputting result on next line after use hits enter, it will output on same line user entered input.
Normally this happens because user must press enter to submit text
./test
Please enter a number: 32
You entered 32.
I would like to do this:
./test
Please enter a number: 32 You entered 32.
An example of a program that does this is gforth for the forth programming language. I was wondering if anyone knew how to do it with simple code.