+ 1
Why some of the compiler showing error when we write void main() in c++?
5 Answers
+ 9
Ah, I was about to post the link but @Jay did it. Yes, void return type for main() has never been a part of the standard, and will never be.
+ 7
@manual: it is not even valid c according to the standard
+ 6
it is not considered valid c++.
here is what the creator of c++ has to say on the matter:
http://www.stroustrup.com/bs_faq2.html#void-main
+ 3
just use int main
void main is for C code with no return value.
+ 3
@Jay
It makes sense,
void main did not seem very useful to me, in C code.