C++ looping through array like numbers

hello i would like to know how to loop through an array like numbers. i used to know how to do this, but i forgot, and can't find my project i made it with.

it goes like this
1
2
3
4
5
6
7
8
9
10
11
12
//begining stuff..
string word;
char loop[52] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//making a word scrambler/unscrambler
cout << "Gimme a word" << endl;
cin >> word;
for(int i=0;i<=word.length()-1;i++)
{
cout << word[i] << word[i+1] << endl;
//idk

}

if you type in LOT it is suppost to return:
L
O
T
LL
LO
LT
OL
OO
OT
TL
TO
TL
LLL
LLO
LLT
LOL
LOO
LOT
Done!
Last edited on
I don't understand how it is supposed to do that. You would need a ton of nested loops for that. I can make it do L O T but to make it do L L you would need many nested loop. Are you sure that is the correct return?
Topic archived. No new replies allowed.