title: more modern way of looping through C++ arrays
body: <p>Recently I have found a lot of examples, most of them regards the C++ 98, anyways I have created my simple-array and a loop (<a href="http://codepad.org/aAdu4Nmo" rel="noreferrer">codepad</a>):</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main ()
  {
     string texts[] = {"Apple", "Banana", "Orange"};
     for( unsigned int a = 0; a &lt; sizeof(texts); a = a + 1 )
     {
         cout &lt;&lt; "value of a: " &lt;&lt; texts[a] &lt;&lt; endl;
     }
  
     return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre>value of a: Apple
  value of a: Banana
  value of a: Orange
  
  Segmentation fault</pre>
  
  <p>It's working fine, except the segmentation fault at the end.</p>
  
  <p>My question is, does this array/loop through is done a good way? I am using C++ 11 so would like to be sure it fits the standards and couldnt be done a better way?</p>