title: Mesh Network using C
body: <p>I'm trying to create a mesh network of size 3*3 in C language for simulation purpose (using <code>CSIM</code>). </p>
  
  <pre><code>X --- X --- X
  |     |     |
  X --- X --- X
  |     |     |
  X --- X --- X
  </code></pre>
  
  <p>The following overlapping loop is supposed to simulate the link between nodes however does not really simulate the mesh topology since it counts the diagonal links as well. I apologize for this question but I really don't know how to modify it to represent a mesh network. Any hint is appreciated.</p>
  
  <pre><code>int net[5][5];
      for(i=0; i&lt;5;i++)
      {
          for(j=0; j&lt;5;j++)
          {
              net[i][j] = link;
          }
      }
  </code></pre>