What is the use of return 0 in C++ main? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the use of return 0 in C++ main?

Example. #include <iostream> Using namespace std; int main(){ cout << "The use of return below" << endl; return 0; }

1st Oct 2020, 6:36 AM
Kingsley Akpabio
Kingsley Akpabio - avatar
2 Answers
0
because you define the main function as int so you must return an integer.
1st Oct 2020, 7:24 AM
darkcris1
darkcris1 - avatar