title: Expand grid R function functionality in c++
body: <p>Some time ago I asked for solution to my problem in <code>R</code> and <a href="https://stackoverflow.com/questions/24506602/get-all-possible-string-sequences-where-each-element-comes-from-different-set-in">expand grid was a perfect solution</a> to it. Is there any <code>c++</code> equivalent for that function (working on char arrays)?</p>
  
  <p>Thank you for any suggestions in advance. </p>