FA> Paul was good enough to add the consts to it, but i don't understand
FA> why would the local pointers have be constant.
PE> The parameters are defined (by ISO) to be constant. The local
FA> Does this apply to all function parameters or just selected ones ?
Just selected ones.
PE> I can't remember though - does the "const" in strstr() mean that
PE> you aren't changing the data that the pointers point to, or that
PE> you aren't changing the pointers themselves? BFN. Paul.
FA> The pointers can be changed ++p p=p1, contents can't, *p='l' .
Thanks. I dimly recall someone saying something about
const char *x;
vs
char * const x;
vs
const char * const x;
I don't know if the last 2 are legal (the dim recollection says
they are), but in future, I'll try to remember the common bit under
the rule "const applies to the closest thing!". BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|