0
String
what if i replace "int main" with "string main" will i have to change "return 0 " then ?
2 odpowiedzi
+ 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" 😜
0
thanks #cohen creber