When I use the constant argument of a function as a array size in C++ it gives "Constant expression required" error:
So the compiler is not considering m
as a constant object, this means I can change the value of m
inside the function, but when I try to increment the value of m
it gives "cannot modify a const object" error:
It is really ambiguous to me. Can anyone please explain what I'm getting wrong?