• 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: Cameron Hayne <email@hidden>
  • Date: Mon, 13 Jun 2005 13:10:57 -0400

On 13-Jun-05, at 12:30 PM, David Fang wrote:

I used to be confused about it a long time ago. Someone
summarized in an earlier post: "const" modifies the thing to the left. If
there's nothing to the left, then it applies to the right.

I think it is easier to just always read declarations from right to left (* is read as "pointer to"):


const char* cs
cs is a pointer to a const char

char* const cs
cs is a const pointer to char

--
Cameron Hayne
email@hidden


_______________________________________________ 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 and fun
      • From: Andreas Grosam <email@hidden>
References: 
 >Re: Const correctness (From: David Fang <email@hidden>)

  • Prev by Date: Re: Moving from CodeWarrior to XCode
  • Next by Date: Shark 4.2 problem: "-[GRGradientColor addColor:]: selector not recognized"
  • Previous by thread: Re: Const correctness
  • Next by thread: Re: Const correctness and fun
  • Index(es):
    • Date
    • Thread