What is the use of int main() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use of int main()

What if we use void main() and left the return 0 statement off?

14th Aug 2017, 4:38 PM
Bhatt Bhaumik
Bhatt Bhaumik - avatar
1 Answer
+ 12
As of the latest standard, main() must return int. Void return type for main() has never been part of standard C++, and will not be supported by modern compilers.
14th Aug 2017, 4:51 PM
Hatsy Rei
Hatsy Rei - avatar