What is return0 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

What is return0

what That does

7th Jan 2017, 12:30 PM
david v
david v - avatar
3 Respuestas
+ 21
It ensures that there is no return value to be given in the function. If you type return 2 in some function foo() then it will return 2 to main function. Similarly return 0 returns nothing to main function.
7th Jan 2017, 12:32 PM
Frost
Frost - avatar
+ 1
ok thx:)
7th Jan 2017, 12:34 PM
david v
david v - avatar
+ 1
0 is the default return value for C++ programs in that case no error occurred. returning other value means error. different return values could mean different errors depending on the program.
7th Jan 2017, 2:52 PM
DFX
DFX - avatar