int to_ascii(char c) { if (c >= 'A' && c <= 'Z') { int ascii_A = 65; int off = ascii_A - 'A'; return c + off; } if (c >= 'a' && c <= 'z') { int ascii_a = 97; int off = ascii_a - 'a'; return c + off; } return -1; }