I'm trying to pass an array by reference to funcA
.
void funcA(int(&a)[], int k);
int main() {
int n = 5;
int x[5];
funcA(x, n);
return 0;
}
However when I try to, it throws this error.
A reference of type "int (&)[]" (non const-qualified) cannot be initialized with a value of type "int [5]"
I tried to find what "non const-qualified" meant, but there weren't any good explanations anywhere. Can someone please explain what it means? Thank you.