title: Return type of main function
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/204476/what-should-main-return-in-c-c">What should main() return in C/C++?</a><br>
    <a href="https://stackoverflow.com/questions/636829/difference-between-void-main-and-int-main">Difference between void main and int main?</a>  </p>
  </blockquote>
  
  
  
  <p>I have always been using the main method in C like </p>
  
  <pre><code>void main(){ // my code }
  </code></pre>
  
  <p>and it works pretty well for me.
  I also know about the other  <code>int</code> return type:</p>
  
  <pre><code>int main(void)
  int main()
  int main(int argc, char *argv[])
  </code></pre>
  
  <p>But I have  not been able to find any resource that says that I can use <code>void</code> as a return type. Every book suggests that the return type must be <code>int</code> or else it be omitted. Then why does <code>void main()</code> work?</p>
  
  <p>Is this dependent on the version of C that I am using? Or does it work because I use a C++ IDE?  Please reply specific to C and not C++. </p>