Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // MessageId: ERROR_LOGIN
- //
- // MessageText:
- //
- // Wrong login
- #define ERROR_NAME 100L
- //
- // MessageId: ERROR_PASSWORD
- //
- // MessageText:
- //
- // Wrong password
- #define ERROR_PASSWORD 101L
- cout << getDescription(ERROR_NAME);
- cout << getDescription(ERROR_PASSWORD);
- "Wrong login"
- "Wrong password"
- // map - имя переменной ассоциативного контейнера
- std::string getDescription(int code)
- {
- if(map.find(code) != map.end())
- return map[code];
- return std::string::npos; // строки нет, или же ""
- }
Add Comment
Please, Sign In to add comment