2005-09-28

void main()

I ran into an issue when trying out Xcode where it would flag an error if main() were declared to return void. Since I knew that in C "void main()" is legal, I went looking on the Net and found this document. Apparently in C++ it's not legal...one of those tricky little differences between the two languages. I guess I missed that in my reading of the Stroustrup book; and although I have a copy of the C standard, I don't have the C++ standard. Nor would I want it...it's not one of my favorite languages.

No comments: