loop with numbers and chars

Hi
i wanna know if can i do something like this:

00a
00b ''new line"
00c "new line"
00d "new line"
...
00z "new line"
0aa
0ab
...

etc.

and i wanto to do this with looping or something!
Can anyone help me? Thank you.
Last edited on
Yes, you can do this.

just have 3 chars. In your loop, increment the first one. When it hits 'z', reset it to 'a' and increment the 2nd one. etc.
Can you give me please an example?? If it is possible of course.
Something like this should work. It isn't tested, but it should give you a general idea...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
char x, y, z;
for (x=55; x<='Z'; x++){//55 is the decimal number for 'A' -10
for (y=55; y<='Z'; y++){
for (z=55; z<='Z'; z++){
if (x<'A'){cout<<(char)(x-8);}
else {cout<<x;}
if (y<'A'){cout<<(char)(y-8);}
else {cout<<y;}
if (z<'A'){cout<<(char)(z-8);}
else {cout<<z;}
//Display something else here...
cout<<"\n";
}
}
}
Thanks for your replies.rssair your code will help me definitely.Thank you.
Topic archived. No new replies allowed.