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

3,749 questions

4,049 answers


10,705 users

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

0 votes
asked 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 by herbert Sr Member (3,620 points)

Related questions

0 votes
1 answer 363 views
0 votes
1 answer 81 views
0 votes
2 answers 4,061 views
+1 vote
1 answer 47 views