Passing by Reference

Create a function that can raise an integer to a specified power. The function has two parameters; the first parameter being the base and the second parameter being the exponent.

The function should not return anything and the result should be stored in the base first variable.

void power(int &base, int exp) {
    // . . .
}


Improve this page