From: naisbodo Newsgroups: comp.lang.c,comp.os.msdos.djgpp Subject: Re: what's this mean? Date: 30 Nov 2000 21:34:41 GMT Organization: http://www.naisbodo.com/ Lines: 42 Distribution: world Message-ID: <906h5h$ih$5@bob.news.rcn.net> References: <3a267c5f DOT 0 AT news DOT syr DOT edu> <906dla$lj3$1 AT news5 DOT isdnet DOT net> X-Trace: IRiY7kSqEWD3/itvFF4BTfJFH7SjoGofTCcUGaSWFCU= X-Complaints-To: abuse AT rcn DOT com NNTP-Posting-Date: 30 Nov 2000 21:34:41 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In comp.lang.c Damian Yerrick wrote: > On Thu, 30 Nov 2000 21:34:43 +0100, "-hs-" > wrote: > >>void mem_err(char const *, char const *) > > YM const char *. No, -hs- is correct. > IIRC IAAYDNRC. > with char const *, it's the pointer that's constant, not the value the > pointer references. With const char *, the pointer can change (using > ++ and -- to move around in the vector), but nothing can be modified > through the pointer. Consider: char const * identifier1; const char * identifier2; char * const identifier3; identifier1 = identifier2; /* works */ identifier2 = identifier1; /* works */ identifier3 = identifier1; /* error! */ The first two are equally qualified. The third, however, cannot be assigned to, because the pointer is constant. This is the distinction you meant to make, I'm sure. Additionally, one can say: const char * const identifier4; char const * const identifier5; These last two are equivalent, as well. -- naisbodo AT enteract DOT com http://www.naisbodo.com/