What I think const is

const is used to make the value or the variable constant.
For Example:

const int a = 7;

now what const does here is it does not allow the variable to change in the runtime.
And thus, we cannot assign a new value at any point in your code .
And even if we try to assign a new value, the compiler will not allow it!
So, this is what I think const is from my opinion, Let me know if I’m correct.

Privacy & Terms