Re: Const correctness
Re: Const correctness
- Subject: Re: Const correctness
- From: George Warner <email@hidden>
- Date: Mon, 13 Jun 2005 09:21:00 -0700
On Fri, 10 Jun 2005 13:04:47 +0200, Andreas Grosam <email@hidden>
wrote:
> On 09.06.2005, at 13:49, Clark Cox wrote:
>> On 6/9/05, Markian Hlynka <email@hidden> wrote:
> In order to be platform independend, i would recommend to declare
> string literal const:
> const char* cs = "I'm const";
> then, you get compiler errors when you attempt to modify the characters.
IIRC "const char* cs" declares a constant pointer to a character string
where "const char *cs" declares a pointer to a constant character string.
In the first case you can modify the string but not the pointer; in the
second you can modify the pointer but not the string that it points to.
I'm sure someone (the syntax police) will let us know if I'm smoking crack.
;-)
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden