title: How can I find out how much space is left on stack of the current thread using vc++?
body: <p>I am using VC++ 2012.
  I would like to be able to tell how much stack memory is available in current thread.</p>
  
  <p>Quick search points to using malloc.h and stackavail() function, yet its not there in Visual C++ 2012. How do I achieve this in another way?</p>
  
  <p>Example in question is this:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;malloc.h&gt;
  
  using namespace std;
  
  int _tmain()
  {
      cout &lt;&lt; "Available stack: " &lt;&lt; stackavail() &lt;&lt; std::endl;
  }
  </code></pre>