Write a function that finds the larger of two integers input (in the main program) but allows you to change the value of the integers in the function using pass by reference. would this be adequate enough or no since it does not allow me to enter different numbers once i put my first numbers in? it takes numbers.
If you want to change the values somewhere (other than swapping them) then you need to input values somewhere or calculate new values for the variables.
Does "change" return anything? If not, change it's return type to void
Does the function "change" return any integers? If it doesn't return anything, then you can make the return type "void".
Is swapping the two numbers all you have to do in "change"? I must have misunderstood what exactly your function needs to do.
If we want to change the value of a variable passed to another function (and have the change persist after the function ends), then we need to pass it by reference.
If you want to give those variables a new value some time, then you should put some code in there to input some new values for those variables.
If so, then just pass them by reference if you want the change to be permanent (for the ones in main to be permanently changed), or leave them as is if you want the change to be temporary (have the values for the variable return to normal after the function call ends).