What is the use of return 0 in C++ main? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
0
because you define the main function as int so you must return an integer.
1st Oct 2020, 7:24 AM
darkcris1
darkcris1 - avatar