How does the const qualification on variables differ in C and C++?
from: Does "const" just mean read-only or something more?
"What prompted this question was this answer: https://stackoverflow.com/questions/4024318#4024417 where he states const "just" means read-only in C. I thought that's all const meant, regardless of whether it was C or C++. What does he mean?"
Best Answer
const
in C cannot be used to build constant expressions.For example :
doesn't work in C because case label does not reduce to an integer constant.