title: Pass array by value to recursive function possible?
body: <p>I want to write a recursive function that builds up all possible solutions to a problem. I was thinking that I should pass an array and then, in each recursive step, set it to all values possible in that recursive step, but then I started wondering if this was possible, since C passes an array by passing a pointer. How do you typically deal with this?</p>
  
  <p>I'm thinking something along these lines. The array will take many different values depending on what path is chosen. What we really would want is passing the array by value, I guess.</p>
  
  <pre><code>recFunc(int* array, int recursiveStep) {
      for (int i = 0; i &lt; a; i++) {
          if (stopCondition) {
              doSomething;    
          }
          else if (condition) {
              array[recursiveStep] = i;
              recFunc(array, recursiveStep+1);        
          }
      }
  }
  </code></pre>