Files
itc.betriebssysteme/pa-03/a3/funktionen/to_ascii.c
2025-11-24 10:36:08 +01:00

14 lines
295 B
C

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;
}