View Single Post
  #3 (permalink)  
Old February 27th, 2006, 09:32 PM
merediths merediths is offline
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default


 Well, you could be tricky w/ the linker and name it something else if you were *really* determined too, but essentially, yes, every ANSI/ISO compliant program must contain a main() function ... not that sometime auto-generated code, for example Win32 project code created by the Visual C++ 5/6 IDE does *not*, however it has a main() funtion in the standard libraries it imports for you.

 HOWEVER you do NOT need to *end* your program in main(). your "void main()" can go anywhere in your program you like ... AFAIK the ending your program w/ main() was an old Pascal convention. I like to have my main() function at the beginning of the file it's in, but that's just personal preference.

Regards,
Meredith Shaebanyan

Reply With Quote