title: How to check if std::cin is associated with a terminal or a pipe
body: <p>How is it possible to check if std::cin buffer is associated with a terminal or a pipe?</p>
  
  <p>Command line which shows that std::cin is associated with a file:</p>
  
  <pre><code>Application.exe &lt; C:\output.txt &gt; C:\result.txt
  </code></pre>
  
  <p>Command line which shows std::cin associated with a terminal:</p>
  
  <pre><code>Application.exe
  </code></pre>
  
  <p>I tried to analyze in_avail() for this purpose. But it hasn't helped.</p>
  
  <pre><code>std::cin.rdbuf()-&gt;in_avail()
  </code></pre>