diff --git a/main.cpp b/main.cpp index f55983a..c995077 100644 --- a/main.cpp +++ b/main.cpp @@ -26,8 +26,10 @@ const map morse_map = { bool should_exit = false; bool is_exit(const string &s) { - return s.length() == 4 && tolower(s[0]) == 'e' && tolower(s[1]) == 'x' && - tolower(s[2]) == 'i' && tolower(s[3]) == 't'; + return s.length() == 4 && tolower(static_cast(s[0])) == 'e' && + tolower(static_cast(s[1])) == 'x' && + tolower(static_cast(s[2])) == 'i' && + tolower(static_cast(s[3])) == 't'; } string read_input(const string &prompt) { @@ -74,7 +76,7 @@ public: MorseEncoder() : char_to_morse(morse_map) {} string encode(char c) { - auto it = char_to_morse.find(toupper(c)); + auto it = char_to_morse.find(toupper(static_cast(c))); return it != char_to_morse.end() ? it->second : ""; }