By default,when you put a Scanf,then you run and enter the data,after that,you press ENTER,so the result jump the next line,my question is:After I typed the data,I want the result show in same line,so how can I do that?
Thanks for helping.
By default,when you put a Scanf,then you run and enter the data,after that,you press ENTER,so the result jump the next line,my question is:After I typed the data,I want the result show in same line,so how can I do that?
Thanks for helping.
I don't really ever use scanf() so I don't know if it always goes to the next line. If it does, you can use gotoxy() to move the cursor back up to the next line and then display your information.
Im not real sure why but scanf doesnt go to the next line on my compiler. I am using dev++ at the moment for windows.
When I was using gcc (with redhat7.3) the scanf did always go to the next line
maybe they have changed it with the new C99 standard?
"Assumptions are the mother of all **** ups!"
I don't understand you, after you pressed ENTER, what scanf() supposed to do? hmm, can you show us the code?
>>after that,you press ENTER,so the result jump the next line
Not really, scanf doesn't know or care about lines, it just reads a stream of characters. What you're talking about is how the cursor on the command line has a line feed when you hit enter after typing something, this has nothing to do with scanf or your program.
*Cela*