title: alternative to multidimensional array in c
body: <p>tI have the following code:</p>
  
  <pre><code> #define FIRST_COUNT 100
   #define X_COUNT 250
   #define Y_COUNT 310
   #define z_COUNT 40
  
  struct s_tsp {
  
       short abc[FIRST_COUNT][X_COUNT][Y_COUNT][Z_COUNT];
  };
  
  struct s_tsp xyz;
  </code></pre>
  
  <p>I need to run through the data like this:</p>
  
  <pre><code>for (int i = 0; i &lt; FIRST_COUNT; ++i)
      for (int j = 0; j &lt; X_COUNT; ++j)
            for (int k = 0; k &lt; Y_COUNT; ++k)
                  for (int n = 0; n &lt; Z_COUNT; ++n)
                        doSomething(xyz, i, j, k, n);
  </code></pre>
  
  <p>I've tried to think of a more elegant, less brain-dead approach. ( I know that this sort of multidimensional array is inefficient in terms of cpu usage, but that is irrelevant in this case.)  Is there a better approach to the way I've structured things here?</p>