title: Code obfuscation for accessing an array in C++
body: <p>I was going through a code that I found online, and found out that the code used to access an array of vectors is a little off-beat (read <em>obfuscated</em>).  </p>
  
  <p>The array <code>graph</code> and <code>visited</code> are declared as follows:</p>
  
  <pre><code>vector&lt; int &gt; graph[ MAXN + 1 ], graphT[ MAXN + 1 ], sorted;
  bool visited[ MAXN + 1 ];
  </code></pre>
  
  <p>And further in the program, it is accessed as below:</p>
  
  <pre><code>if ( !visited[ graph[ S ][ i ] ] ) {         //---&gt;&gt;&gt;???
              dfs1( graph[ S ][ i ] );
          }
  </code></pre>
  
  <p>Could someone please help me explain how is <code>visited [ graph[ S ][ i ] ]</code> correct syntax to access the <code>visited</code> array?  Also, is there any other simpler way to access it?</p>
  
  <p>Note: <code>S</code> is just any random variable, with value, say <code>1</code>.  Actual link of the code is <a href="https://github.com/VitSalis/SPOJ/blob/master/BOTTOM/bottom.cpp" rel="nofollow">here</a>. I am talking about lines 9, 10, 27, 28 and 29.  Of course, the code compiles successfully and generates the required output.  Thanks.</p>