title: rename() returns -1. How to know why rename fails?
body: <p>I am using c++ stdio.h's</p>
  
  <pre><code>int rename ( const char * oldname, const char * newname );
  </code></pre>
  
  <p>rename() function to rename a folder but occasionally it fails to rename the folder and returns -1.</p>
  
  <p>Is there any way to know why is rename() failing?<br>
  any way to know this error explanation via any c++ function.</p>