pa-03
This commit is contained in:
13
pa-03/a3/funktionen/to_ascii.c
Normal file
13
pa-03/a3/funktionen/to_ascii.c
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user