title: Crossword game: read 2d given array and search diagonally c++
body: <p>This is a <code>crossword game</code>. I wanna read an array diagonally.
  I should find some word in all over the 2d given array
  this array read from a given file
  and it is n*m size; m not always = n</p>
  <p>How can I read 2d given diagonally like this:</p>
  <p>Example:</p>
  <pre><code>m = 4
  n = 4
  b o o k
  z a k o
  s l l e
  x y z l
  
  ball: found
  
  [b] o o k
  z [a] k o
  s l [l] e
  x y z [l]
  
  foo: not found
  </code></pre>
  <p>Here is the code:</p>
  <pre><code>char ReadArray(char* array, int r, int c, int n, int m)
  {
     return (r &gt; 0 &amp;&amp; r &lt;= n &amp;&amp; c &gt; 0 &amp;&amp; c &lt;= m) ?
                    array[n * (r - 1) + (c - 1)] : '\0';
  }
  </code></pre>