title: What is the type of the errno variable in C++?
body: <p>I was doing some system programming in C++, and I want to pass the errno variable in linux systems to my exception handler. You can see example code in here 
  <a href="https://pastebin.com/ppgMc8Hj" rel="nofollow noreferrer">https://pastebin.com/ppgMc8Hj</a> </p>
  
  <pre><code>#include &lt;sys/stat.h&gt;
  #include &lt;cerrno&gt;
  #include &lt;iostream&gt;
  #include &lt;cstring&gt;
  
  std::string errorString(int errno){
      return std::strerror(errno);
  }
  
  int main(){
      struct stat sb;
      errno = 0;
      if(stat("/jdfj/", &amp;sb)){
          errorString(errno);
      }
      else{
          std::cout &lt;&lt; std::boolalpha &lt;&lt; S_ISDIR(sb.st_mode) &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>But it returns an error like this</p>
  
  <pre><code>In function 'int main()': 
   14:26: error: invalid conversion from 'int' to 'int* (*)()' [-fpermissive] 
    6:13: note: initializing argument 1 of 'std::string errorString(int* (*)())'.
  </code></pre>
  
  <p>I have seen here <a href="http://en.cppreference.com/w/cpp/string/byte/strerror" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/string/byte/strerror</a> that the standard function that returns a string from errno accepts an int as argument.
  My question is </p>
  
  <ol>
  <li>If it is an int type why doesn't it work in the above code?</li>
  <li>If not what is it's type?</li>
  </ol>