Array vs pointer in C

A common pattern (I use the word loosely) in my C programs is to have an array of structs to hold things like asteroids and bullets in the game. There are two ways to process an array:
- As an array e.g. asteroids[index].
- As a pointer to an individual array element. Asteroid * pAsteroid = &(asteroids[index]); then refer to pAsteroid ->
One of the tents of software design though not that often said is that the easier the code is to read, the easier it is to understand. Programmers spend a lot of time reading code. Anything that lightens the cognitive load is good. I suspect it might also be faster, but not by a great deal.
Of course pointers make some programmers nervous. To me though they simplify the code. There is however another way to simplify the code. Use #define so you might have something like this:
#define table asteroids[index]
So everywhere you have a asteroids[index]., you put in table instead.
This for example from Chapter 36 DrawAsteroids()
for (int i = 0; i<MAXASTEROIDS; i++) {
if (asteroids[i].active) {
numAsteroids++; // keep track of how many onscreen
int sizeIndex = asteroids[i].size; // 0-3
int asize = sizes[sizeIndex]; // asteroid size 280,140, 70,35
target.h = asize;
target.w = asize;
asteroidRect.h = asize;
asteroidRect.w = asize;
asteroidRect.x = asize * asteroids[i].rotdir;
target.x = (int)asteroids[i].x;
target.y = (int)asteroids[i].y;
Would become
for (int i = 0; i<MAXASTEROIDS; i++) {
if (table.active) {
numAsteroids++; // keep track of how many onscreen
int sizeIndex = table.size; // 0-3
int asize = sizes[sizeIndex]; // asteroid size 280,140, 70,35
target.h = asize;
target.w = asize;
asteroidRect.h = asize;
asteroidRect.w = asize;
asteroidRect.x = asize * table.rotdir;
target.x = (int)table.x;
target.y = (int)table.y;
What do you think?


Sometimes you just need to view or maybe a binary file and here I’ve done that on the compiled file for asteroids.
If you are using RNGs (Random Number Generators) for cryptography then you need one that has been validated for sufficient randomness. For example the
At some time or other you are going to need a binary editor, to let you look in files and see what they contain.
Here’s it on 
I needed this in a bit of debug code. I wanted it to work like printf where there’s a format string containing one or more % format specifications and then write this into a buffer and dump it where ever.