title: Accessing multiple elements of a matrix in C++
body: <p>I have following Matlab code:</p>
  
  <pre><code>A = rand(4); % just for an example
  B = A(1:3,1:2); 
  </code></pre>
  
  <p>Thus B will be a 3x2 matrix and will contain elements of A starting from first row to third row and first column to second column. I could certainly do this in C++ with a for loop, but is there an easier way (like Matlab) to do this?</p>