+ 1
Is there any code/keyword for return number WITHOUT using return keyword ?
We can return values/char/string with using return keyword.
4 Answers
+ 10
Passing variable by reference to function and altering the value from there?
void func(int& Val)
{
Val = 6;
}
int main()
{
int ori_Val = 10;
func(ori_Val);
std::cout << ori_Val;
}
+ 6
In Python there is also a yield method, which you may exploit as returning values...
+ 2
Or globals.
+ 2
And at least in C++ and Java, you can throw and catch stuff.