I found the following code in a forum and i was wondering how does the const
qualifier behaves in it?
const uint8_t data[] = { 15, 3, 41, 76, 2, 9, 5 };
val = data[5];
Now, as i understand the const
qualifier makes the variable data[]
read-only so that, in this example, the contents of the array can't be modified.
What confuses me is that the qualifier is being applied to an array, which is a pointer so the contents of the array can be modified but the pointer itself can't.
Am i right?, or is the content of the array read-only?