TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Paul Edwards
date: 1996-06-16 21:46:22
subject: Find a word

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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.