I cannot seem to get my program to show both values I have listed within the ''
. I have it listed as 'Aa'
, 'Bb'
, and so on, but when I run the code it only shows the second letter (lowercase letter). I have tried changing up from int
conversions, pointers, and other things, but cannot figure this part out. Any help is greatly appreciated!
Here is my code:
#include "stdafx.h"
#include <iostream>
#include <cctype>
#include <string>
using std::cin;
using std::cout;
using std::endl;
int main()
{
char letters[] = { 'Aa', 'Bb', 'Cc', 'Dd', 'Ee', 'Ff', 'Gg', 'Hh',
'Ii', 'Jj', 'Kk', 'Ll', 'Mm', 'Nn', 'Oo', 'Pp', 'Qq', 'Rr', 'Ss',
'Tt', 'Uu', 'Vv', 'Ww', 'Xx', 'Yy', 'Zz', '\0'};
for (char * cp = letters; *cp; ++cp)
{
if (*cp == 0) break;
printf("%c", *cp);
}
cout << endl;
}
It displays the alphabet, but just the lowercase values. How can I get it to display both the uppercase and lowercase values in the ''
?