-2

i cannot to see what i write to the console (Eclipse C++) during debugging

    for (int i=0; i<5; i++) {
        cout << i;
    }

How to configure Eclipse writting on console while debuging ?

2 Answers 2

1

related Eclipse CDT : running C++ program not showing anything in the console! Why? Eclipse CDT : running C++ program not showing anything in the console! Why? C++ program written in Eclipse using Windows and MinGW cannot display output to console view or it might be a bug if you are on win x64: https://bugs.eclipse.org/bugs/show_bug.cgi?id=236330

Sign up to request clarification or add additional context in comments.

Comments

0

It is not Eclispe (which is an editor, not a compiler; probably your Eclipse would run a compiler like GCC using the g++ program; and then you are running the compiled executable.).

If you don't see your expected output, it is probably because your output stays buffered.

You could try the std::flush manipulator.

   for (int i=0; i <5; i++)
        std::cout << i << std::flush;

See this question and the several good answers there.

You might read more about the std::endl manipulator. I suggest doing std::cout << std::endl from time to time.

You could consider using the std::clog output stream.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.