+ 2

[SOLVED] How can I print something to console before getting user input in eclipse?

hey, I'm using eclipse AND I wanted to know why it works the way I want when I execute the exe file that the compiler made of my code? * I know it doesn't work in sololearn it's about Eclipse IDE. this is my code: https://code.sololearn.com/cM2S0v63m9lU/?ref=app

6th Jun 2021, 1:09 PM
hamid
hamid - avatar
6 Antworten
+ 2
well, finally I found the solution. the solution is to simply add fflush(stdout); after printf(). while it's still not working here but yeah thanks, I found my answer.
7th Jun 2021, 7:35 AM
hamid
hamid - avatar
+ 3
Don't worry hamid , It only happens in Sololearn. Sololearn takes all input at running time. That's why before printing the input box is coming! NOTE - Don't ask many questions in one post only
6th Jun 2021, 1:21 PM
Abhiyantā
Abhiyantā - avatar
+ 2
Rishav Tiwari Thanks for answering I know it doesn't work in here my question is about Eclipse. In Eclipse it first asks for user input, then when you press the enter the rest of the code will execute while I want to execute the printf() then ask for user input.
6th Jun 2021, 8:18 PM
hamid
hamid - avatar
+ 2
Rishav Tiwari What made you think I hadn't done any research on it? have you find anything on the internet?
7th Jun 2021, 4:06 AM
hamid
hamid - avatar
+ 2
Go to ellipses sites, types your problems or do one thing see YouTube to see how to install
7th Jun 2021, 4:11 AM
Abhiyantā
Abhiyantā - avatar
+ 1
Why don't you try Google for it!
7th Jun 2021, 1:05 AM
Abhiyantā
Abhiyantā - avatar