Double Constant???

Why do some parameter values have two "Constant" symbols on them... Example:

1
2
3
4
5
void Function( constant int number constant){
~~~~~~~~
~~~~~
~~~~
}
Last edited on
That cannot and will not compile. Even if you removed the ~ and changed constant to const, it is still wrong.
Yeah, I know I wrote it wrong. The Example Im confused about is this... And this is from a book.


Function( const char * const variable1, const char* const last)

why are there two const keywords for 1 parameter varaible?

They are both constant pointers to constant characters.
i see.
The const before the * means that you can't modify the object pointed to (char). The const after the * means you can't modify the pointer (variable1) to make it point elsewhere.
Topic archived. No new replies allowed.