+ 2
I wnat two parameters to "return" from my function,what should I do?
EX: Int function yeah(int a,int b){ Int Sum = a+b; Int Sub =a-b; Return sum,sub;}
4 ответов
+ 8
Declare a variable in the main function and then you can pass it by reference or by pointer to change in its original value.
int main() {
int sum = 0;
int sub = function_yeah(a, b, sum) ;
}
int function_yeah(int a, int b, int &sumRef) {
sumRef = a + b;
int sub = a - b;
return sub;
}
+ 3
Tnx😄
+ 2
Hello, 😊
Can you specifying your question correctly!
Use the search bar!
https://www.sololearn.com/post/10362/?ref=app
Please, read our guidelines:
https://www.sololearn.com/discuss/1316935/?ref=app
An useful code for any new user here!;)
https://code.sololearn.com/WvG0MJq2dQ6y/
+ 2
Assume that we have a circule equation...if we use a X we'll get two Y s but we can't use FUNCTION because it will return us one value...