I am trying to understand the use of const. I understand that const is used to keep data from being changed. What I don,t understand is how you can use const with values that are not initailly known.
For example, If I have a list of values that I read in from a file and I create an array declared as
Code:
double list[SIZE] = {'\0'};
and I want to protect that data by making it
Code:
const double list[specific length read in]
.
Can I do this? AND Can you do it without pointers?
Is the only way to use const in this manner by initilizing the values with const?