Loop through all letter and number possibilities?

What I mean is how do i make a loop in C++ that cycles through all possible combinations of letters and numbers (with a limit of course). Like have it start with 0 and next have it be 00, 000, 0000... And then after like 5 digits of zeros have a 1 added (00001) And continue on adding letters.

Ending with "zzzzz"

I realize it would take a long time to list them all but i still want to know what the code would be like.
closed account (yUq2Nwbp)
it looks something like this

#include<iostream>

void print(int arr[])
{
for(int i=0;i<5;i++)
std::cout<<arr[i]<<" ";

std::cout<<std::endl;
}

int main()
{
int arr[5]=0;

for(int i=4; i>=0 ; i--)
{
for(int j=1;j<9;j++)
{
arr[i]=j;
print(arr);
}
}

return 0;
}

.......for array of chars you must write similiar code
Topic archived. No new replies allowed.