title: How to display asterisk for input password in C++ using CLion
body: <p>There is a lot of sample code online for a password program that hides the input with an asterisk. These programs work when I compile them with my CodeBlocks IDE by outputting a <code>*</code> everytime I type in a letter. </p>
  
  <pre><code>Enter Password  : ******
  You entered : iiiiii
  Process returned 0 (0x0)   execution time : 6.860 s
  Press any key to continue.
  </code></pre>
  
  <p>However, when I use the CLion IDE, I can see the letters I type:</p>
  
  <pre><code>Enter Password  :iiiiii
   ******
  You entered : iiiiii
  Process finished with exit code 0
  </code></pre>
  
  <p>Can someone explain why this difference exists between the two IDEs?</p>
  
  <p>The code that I am using (I found it online) is:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  #include &lt;stdlib.h&gt;
  using namespace std; //needed for cout and etc
  
  int main()
  {
      START:
      system("cls");
      cout&lt;&lt;"\nEnter Password  : ";
      char pass[32];//to store password.
      int i = 0;
      char a;//a Temp char
      for(i=0;;)//infinite loop
      {
          a=getch();//stores char typed in a
          if((a&gt;='a'&amp;&amp;a&lt;='z')||(a&gt;='A'&amp;&amp;a&lt;='Z')||(a&gt;='0'&amp;&amp;a&lt;='9'))
              //check if a is numeric or alphabet
          {
              pass[i]=a;//stores a in pass
              ++i;
              cout&lt;&lt;"*";
          }
          if(a=='\b'&amp;&amp;i&gt;=1)//if user typed backspace
              //i should be greater than 1.
          {
              cout&lt;&lt;"\b \b";//rub the character behind the cursor.
              --i;
          }
          if(a=='\r')//if enter is pressed
          {
              pass[i]='\0';//null means end of string.
              break;//break the loop
          }
      }
      cout&lt;&lt;"\nYou entered : "&lt;&lt;pass;
      //here we can even check for minimum digits needed
      if(i&lt;=5)
      {
          cout&lt;&lt;"\nMinimum 6 digits needed.\nEnter Again";
          getch();//It was not pausing :p
          goto START;
      }
      return 0;
  }
  //Lets check for errors.
  //You can even put file system.
  </code></pre>
  
  <p>I know that there are a lot of questions similar to this one, however, none of them could explain why it is not working when using the CLion IDE.</p>