+ 1

Is there any code/keyword for return number WITHOUT using return keyword ?

We can return values/char/string with using return keyword.

11th Mar 2018, 12:11 PM
Nilesh Shinde
Nilesh Shinde - avatar
4 Respostas
+ 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; }
11th Mar 2018, 12:18 PM
Hatsy Rei
Hatsy Rei - avatar
+ 6
In Python there is also a yield method, which you may exploit as returning values...
11th Mar 2018, 2:52 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
Or globals.
11th Mar 2018, 1:34 PM
Timon Paßlick
+ 2
And at least in C++ and Java, you can throw and catch stuff.
11th Mar 2018, 5:23 PM
Timon Paßlick