title: How to know if std::cin is from redirect?
body: <p>Let's say I have a small program like:</p>
  
  <pre><code>int main() 
  {
      cout &lt;&lt; "Please enter the param &gt;" &lt;&lt; endl; // &lt;-- Print only if input from console
      std::string param;
      cin &gt;&gt; param;
      //Doing some calculations...
      cout &lt;&lt; "result is..."
  } 
  </code></pre>
  
  <p>I want to print the request for the parameter only if the input is from the console, but if the program was started with redirect <code>myApp.exe &lt; textfile.txt</code> then I see no point in printing it.</p>
  
  <p>How can I achieve this behavior?</p>
  
  <p>Edit - I'm working on windows.</p>