What I'm asking is does a C const variable defined in such a way that its value is known at compile time:
const int num = 3;
int main(){
int arr[num];
}
act in the same way as a preprocessor define:
#define num 3
int main(){
int arr[num];
}
In that the compiled code would look like:
int main(){
int arr[3];
}
In both cases?
Now there might be a nuance where the code with the const looks more like:
const int num = 3;
int main(){
int arr[3];
}
Which would also be acceptable, but you understand what I'm asking, which is whether it needs to reference the const at runtime.