Firstly I should say that I have very little C experience, and when I say very little I mean about 2 1/2 hours. So please forgive and correct any inaccuracies, stupidities, or other personal failings.
Here is the code as it currently stands:
typedef struct
{
float n;
int x;
int y;
int values[5];
} Cell;
typedef Cell Grid[10][10];
void update(Grid *source)
{
// This should be a 2D array of Cells.
// All the values in the Cell should be 0,
// including the contents of the values array.
Grid grid;
}
Update will be called fairly frequently and is somewhat performance critical, so I am willing to sacrifice some readability/simplicity/coding time if required for the sake performance. No, this is not premature optimisation.
Thanks for any help,
Sam.