How can I make a "char loop"? I mean, a programm that writes all chars from a to z. Do I have to make it with for loop or how? Is there a possibility to make that with enum? Write your solutions.
Thx in advance
ALan
This is a discussion on chars within the C++ Programming forums, part of the General Programming Boards category; How can I make a "char loop"? I mean, a programm that writes all chars from a to z. Do ...
How can I make a "char loop"? I mean, a programm that writes all chars from a to z. Do I have to make it with for loop or how? Is there a possibility to make that with enum? Write your solutions.
Thx in advance
ALan
Code:for( char cValue = 'a'; cValue <= 'z'; cValue++ ) cout << cValue << endl;
I used to be an adventurer like you... then I took an arrow to the knee.
>How can I make a "char loop"? I mean, a programm that writes all chars from a to z.
>
With ASCII it is quite easy.
>Do I have to make it with for loop or how? Is there a possibility to make that with enum?
No, you do not have to
>Write your solutions.
>Thx in advance
Code:#include <iostream> int main (){ for(int i='a';i<='z';i++) std::cout<<(char)i; return 0; }