Re: multidimensional arrays
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