C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

Should I use void main() or int main() in cpp?

0 votes
63 views
asked May 28, 2011 by anonymous

1 Answer

0 votes
 
Best answer
int main()

main() must return int. Not void, not bool, not float. int. Just int, nothing but int, only int.

Some compilers accept void main(), but that is non-standard and shouldn't be used. Instead use int main().
answered May 28, 2011 by herbert Sr Member (3,620 points)

Related questions

0 votes
1 answer 361 views
361 views asked Oct 20, 2011 by arnav Sr Member (1,250 points)
0 votes
1 answer 80 views
0 votes
2 answers 4,054 views
0 votes
1 answer 417 views
+1 vote
1 answer 47 views
...