ASCI code in array

hello.. I am new here in cplusplus.com.. and I'm here to ask a question regarding with our project in school "the ASCI code in array form".. please help me to get the codes on how to do it.. by the way, letters from A-Z only even the small ones.. thanks..
You can just use the character literals to get the ASCII codes:
1
2
3
4
int /*or char or whatever type you need*/ array[26];
//fill it:
for ( int l = 'A'; l <= 'Z'; l++ )
    array[l-'A'] = l;
ahh.. so you mean I'm just going to use the "for loop statement"?..
ok thanks.. one more thing, am I going to use the same format in "for" with the other letters?
Yes, Notice that this loop would work properly only if the encoding is ASCII for sure
ok..i'll try to do it..thanks..
Topic archived. No new replies allowed.