+ 1
Why we use return( ) in c++?
3 Respostas
+ 1
sometimes we want dunction to return some value may be integer , string,float ,chars. for that we use
return .
we return data whose tyoe matches with return type.
i case of void - void means null i.e. no return type hence we never return somthing
0
int main()
{
return 0;
}
is a global function and like all functions must return a value, even void (the value is no value.)
0
it is required to return a value especially if your function has a return value like int, float, double, etc. if you want a function that is not returning a value use void return type.