title: Every n element of an array in C++
body: <p>Are there more efficient methods of getting every second (every N in general) element of an array then the simple for loop below? For example with the use of generic algorithms?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      const int a_size = 6, b_size = 3;
      int a[a_size] = {1, 3, 6, 3, 2, 7}; 
      int b[b_size];
      int bx = 0;
      for ( int ax = 0; ax &lt; a_size; ++ax )
      {   
          if (ax % 2 == 0)
              b[bx++] = a[ax];  
      }   
  }
  </code></pre>