String | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

String

what if i replace "int main" with "string main" will i have to change "return 0 " then ?

10th Oct 2016, 2:02 PM
Abrar Khan
Abrar Khan - avatar
2 Respuestas
+ 2
Don't change the return type for main, not even with void. An integer return type of int for main is standard for C++, and some compilers don't even let you set the return type to anything other than int. A return type of int is needed to show whether or not the program ran successfuly or not. But let's take for instance that you CAN have string main. Yes, you will have to return a string an not an integer, just like with any other function... unless you did like return "0" 😜
10th Oct 2016, 2:41 PM
Cohen Creber
Cohen Creber - avatar
0
thanks #cohen creber
10th Oct 2016, 4:42 PM
Abrar Khan
Abrar Khan - avatar