• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Const correctness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Const correctness
      • From: David Fang <email@hidden>
  • Prev by Date: Re: Copying folders to SharedSupport
  • Next by Date: Re: Const correctness
  • Previous by thread: Re: Const correctness
  • Next by thread: Re: Const correctness
  • Index(es):
    • Date
    • Thread