I installed the studio version of Clion : I want to Pycharma after Pycharma and ide for a loved one с++ .
I launched standard helloworld - all the rules: mingw was found, everything works. But, when there is a request to enter a variable through cin and output through cout , the variable is displayed twice.
Zakomentil output and, after entering the variable, still displays the value of the variable.

How to fix this? Yato i'm doing wrong enter image description here

    2 answers 2

    You pass the parameters to the executable file not directly, but through the Clion console. As soon as input to the console is completed, Clion passes these parameters to the application.

    Now an example. Application code:

     #include <iostream> #include <stdlib.h> using namespace std; int main() { int buf1; int buf2; cin >> buf1 >> buf2; system("pause"); cout << buf1 <<" " << buf2 << endl; system("pause"); return 0; } 
    1. Through the Windows command line

    enter image description here

    1. Through the Clion console from under Windows

    enter image description here

    1. Through the Clion console from under Unix of a similar system

    enter image description here

    At each start, we pass the string "1 2 3 4" to the parameter to see what will be written in the variables. As you can see, only Clion from under Windows has duplicated the values. It seems to me that this behavior is due to the feature of entering parameters into the console of the operating system, and not the environment.

      This CLion “feature” with duplication of console output can be disabled as follows:

      In the main menu, go to Help and click on Edit Custom Properties . CLion will offer to create an idea.properties file - agree. In the file that opens, add the configuration parameter:

       run.processes.with.pty = false 

      Restart CLion. Everything, I categorically congratulate you.

      enter image description here