I am trying to pass a constant integer into a function using pass by reference.
#include <iostream>
using namespace std;
int test(int& num);
// changes a constant variable
int main() {
int loopSize = 7;
const int SIZE = loopSize;
cout<<SIZE<<endl;
test(loopSize);
cout<<SIZE;
return 0;
}
int test(int& num){
num -= 2;
}
However, the output is never updated.