C problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C problem

Hello guys I wanted to create an alphabetic array with out. writing all of it like abcdefg..... so how is it done ?

14th Mar 2019, 2:09 PM
Dynno
Dynno - avatar
2 Answers
+ 4
You declare a char array of size 26, and use a for loop to initialize the array by iterating from 97 to 122 (lowercase a - z ASCII). http://www.asciitable.com/
14th Mar 2019, 2:18 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
Hatsy Rei so I will just compare THE_STRING[i] < 122 &&the_string[i]> 97? to make sure a password have at least one uppercase letter ?
14th Mar 2019, 2:22 PM
Dynno
Dynno - avatar