+ 1

Return

What does return mean I don’t really get it and what happens if you put the return value to 1

11th Aug 2018, 9:27 PM
Ilyane
3 Respuestas
+ 2
Return was created to return a value. For example you can created a function: int count() { int result=1+2; return result; } int number=count() ; //number = 3
11th Aug 2018, 9:38 PM
Théophile
Théophile - avatar
+ 1
In main() {}, return 0 is there to say that your code was correctly executed. But you can change the value.
11th Aug 2018, 9:40 PM
Théophile
Théophile - avatar
0
thanks
11th Aug 2018, 9:39 PM
Ilyane