I have several data that looks like this:
Vector1_elements = T,C,A
Vector2_elements = C,G,A
Vector3_elements = C,G,T
..... up to ...
VectorK_elements = ...
The basic difficulty with recursion here is that you need to keep track of the entire list of indices (or else construct the string incrementally, as another question points out).
An expedient way to handle this problem without constructing additional objects inside the loops is to hand your recursive function a vector of indices, of the same length as the vector of vectors:
void printcombos(const vector >&vec,vector&index,int depth) {
if(depth==index.length()) {
for(int i=0; i &myvec= vec[depth];
int mylength= myvec.length();
for(int i=0; i