title: Determine all square sub matrices of a given NxN matrix in C++
body: <p>GIven an NxN square matrix, I would like to determine all possible square sub matrices by removing equal number of rows and columns.</p>
  
  <p>In order to determine all possible 2x2 matrices I need to loop 4 times. Similarly for 3x3 matrices I need to loop 6 times and so on. Is there a way to generate code in C++ so that the code for the loops is generated dynamically? I have checked some answers related to code generation in C++, but most of them use python in it. I have no idea regarding python. So, is it possible to write code to generate code in C++? </p>