- #1
charmedbeauty
- 271
- 0
Homework Statement
I have some code and I use getchar to read in some input from the user say a5
I have assigned
char letter;
int number;
letter = getchar();
number = getchar();
so that putchar(letter) prints a
and putchar(number) prints 5
but when I try ... letter=letter - 'a';
I am trying to make this my zero index of array.(i should probably also have a minus one ther for zero indexing.)
putchar(letter) does not print anything??
I am basically trying to convert the letters into integers so I can use an array with input say [a][5].
HELPPPPP!
Last edited by a moderator: