• 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: Pandaa <email@hidden>
  • Date: Wed, 16 Mar 2005 04:00:11 +0100


2005-03-16 kl. 01.49 skrev John Stiles:

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.

Yes, really. Read up on auto vectorization.

Did you know that a[b] is the exact equivalent of *(a+b)? Yes, for any a and b that you could think of.

Of course, a[b], b[a], *(a+b) are all equivalent.

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 :)


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. email@hidden . . www.synapticpulse.net .
 _______________________________________________
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

References: 
 >RE: multidimensional arrays (From: Jeff Laing <email@hidden>)
 >Re: multidimensional arrays (From: Pandaa <email@hidden>)
 >Re: multidimensional arrays (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Newbie Trouble with Basic Bindings
  • Next by Date: Re: Odd NSData initWithContentsOfURL: issue
  • Previous by thread: Re: multidimensional arrays
  • Next by thread: Re: multidimensional arrays
  • Index(es):
    • Date
    • Thread