I wanted to convert an integer to a letter. For example:
1 = A
2 = B
3 = C
...
26 = Z
Is there a way I could do this without using an array?
I wanted to convert an integer to a letter. For example:
1 = A
2 = B
3 = C
...
26 = Z
Is there a way I could do this without using an array?
You could use code like
int i = 1; // or 2, 3, ... 26
char resultChar = i + 'A' - 1; // resultChar will be 'A' or 'B' etc.