How do you move on after a scanf without pressing "enter".

I am trying to get a string from the user and move on without requiring the user to type "enter"
1
2
scanf("%s",&random);//scan
printf("%s",random);//echo of the text, this is the bit that should execute when character x is pressed; 

is this possible? If it is how do I do it?
is this possible?


Not with the standard lib. To do this you'll either need to get into platform specific stuff or use some other library like ncurses.

The real question, though, is why would you need to do this?
I want a program that scans a string, proses it and spits it back out on the same line. What would I need to do that?
Last edited on
I'm not sure what you mean. You want to echo the string the user just inputted...over the string they just wrote? I don't know what that is supposed to accomplish.
I want to scan a sting and print something on the same line next to the string that was scaned.
Last edited on
Topic archived. No new replies allowed.