title: "Debug assertion failed" error
body: <p>there is debug assertion failed error. Can someone get to the probem.</p>
  
  <blockquote>
    <p>Debug Assertion Failed !</p>
    
    <p>Program:..<br>
    File:fclose.c<br>
    Line:47</p>
    
    <p>Expression:(stream!=Null)</p>
  </blockquote>
  
  <p>I am debugging the code in visual studio.</p>
  
  <p>Here is the Part of the code:</p>
  
  <pre><code>int __cdecl fclose (
          FILE *stream
          )
  {
          int result = EOF;
  
          _VALIDATE_RETURN((stream != NULL), EINVAL, EOF);
  
          /* If stream is a string, simply clear flag and return EOF */
          if (stream-&gt;_flag &amp; _IOSTRG)
                  stream-&gt;_flag = 0;  /* IS THIS REALLY NEEDED ??? */
  
          /* Stream is a real file. */
          else {
                  _lock_str(stream);
                  __try {
                          result = _fclose_nolock(stream);
                  }
                  __finally {
                          _unlock_str(stream);
                  }
          }
  
          return(result);
  }
  </code></pre>