title: Generating all the values of N nested for loops
body: <p>I would like to write a function to do the following, given two arguments to the function <code>int K</code> and <code>int nest_level</code> generate all possible points that result from creating <code>nest_level</code> nested loops where each loop ranges from <code>-K</code> to <code>K</code>. For example if <code>k = 5</code> and <code>nest_level = 3</code> the function prints the sequences of numbers that result from the following:</p>
  
  <pre><code>for(int i = -k; i &lt;= k; ++i)
      for(int j = -k; j &lt;= k; ++j)
          for(int m = -k; m &lt;= k; ++m)
              print(i, j, k)
  </code></pre>
  
  <p>This should work for any <code>K</code> and <code>nest_level</code></p>
  
  <p>From my research, I understand this should be a recursive solution but i'm having difficulty implementing it specifically in C++.</p>