• 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: multidimensional arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multidimensional arrays


  • Subject: Re: multidimensional arrays
  • From: John Stiles <email@hidden>
  • Date: Tue, 15 Mar 2005 16:49:36 -0800

On Mar 15, 2005, at 4:33 PM, Pandaa wrote:

Many optimizations requires good data dependency analysis, which the compiler may have difficulties doing on pointer arithmetic expressions.


Not really.
Did you know that a[b] is the exact equivalent of *(a+b)? Yes, for any a and b that you could think of.
For example, this rule is why 1[x] compiles and runs just as well as x[1]. (Yup, it does—try it.) Or why you can convert a number to a hex character with "0123456789ABCDEF"[number].
C is full of clever tricks like this that you should avoid because they are hard to understand when you look back at your old code a year or two later :)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: multidimensional arrays
      • From: Pandaa <email@hidden>
References: 
 >RE: multidimensional arrays (From: Jeff Laing <email@hidden>)
 >Re: multidimensional arrays (From: Pandaa <email@hidden>)

  • Prev by Date: Re: multidimensional arrays
  • Next by Date: Re: slow NSWorkspaceDidWakeNotification
  • Previous by thread: Re: multidimensional arrays
  • Next by thread: Re: multidimensional arrays
  • Index(es):
    • Date
    • Thread