The code
Code:
int val = *((&table) + index);
is equivalent to
Code:
int val=table[index];
In fact, I think they compile down to the same code at the end.
This reminds me of an
IOCCC entry [
hint file] that used index[array] instead of array[index] because the pointer math is in reality the same.
__________________
-Patrick Horn,
Paly Robotics
Check out the space simulator called
Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played
Wing Commander, or especially
Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods:
Privateer Gemini Gold and
Privateer Remake!
I'm working on adding multiplayer support this year...