title: C++ Generate Permutations of a set recursively
body: <p>I've been assigned the task of writing a C++ function that <em>returns</em> all possible permutations from a group of integers. I've done a bit of research but all algorithms I find show the permutation being printed out. </p>
  
  <p>The problem I'm running in to is I don't know how to set up the function, specifically, how I should handle receiving data from recursive calls. My first guess was to use a linked list, but I know if I try to return a pointer to a Node I'll end up with a pointer to invalid memory.</p>
  
  <p>My other guess was to use some sort of global linked list of vectors, but I can't imagine how I could add to the linked list from a function itself. Further, this is more sidestepping the problem than actually solving it, and I'd like to actually solve it if at all possible.</p>
  
  <p>As this is a homework problem, I don't expect anyone to hand me an answer outright. I'm just lost and would greatly appreciate someone pointing me in the right direction.</p>