const int pointer

 
const int * CI;


Does CI point to a const int, or is CI a const pointer that points to an int?


Edit: And also in the same vein, is a "One Eyed One Horned Flying Purple People Eater"
a one-eayed, one-horned, flying puruple monster that eats people, or a one-eyed, one-horned, flying monster that eats purple people?
Last edited on
It's a pointer to a const int. A const pointer to int would be: int* const CI;
The good thing about programming languages is that they're not ambiguous.
So Would I be able to use a const pointer to bypass some compilers limitations on not being able to declare a variable sized array?

for instance you could do something like this:

1
2
3
4
const int ten = 10;
const int * CI; *CI = ten; 
bool array[*CI];

No, an array size must be a constant known at compile-time.
Topic archived. No new replies allowed.