Guest User

Untitled

a guest
Jan 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. //
  2. // MessageId: ERROR_LOGIN
  3. //
  4. // MessageText:
  5. //
  6. // Wrong login
  7. #define ERROR_NAME 100L
  8.  
  9. //
  10. // MessageId: ERROR_PASSWORD
  11. //
  12. // MessageText:
  13. //
  14. // Wrong password
  15. #define ERROR_PASSWORD 101L
  16.  
  17. cout << getDescription(ERROR_NAME);
  18. cout << getDescription(ERROR_PASSWORD);
  19.  
  20. "Wrong login"
  21. "Wrong password"
  22.  
  23. // map - имя переменной ассоциативного контейнера
  24. std::string getDescription(int code)
  25. {
  26. if(map.find(code) != map.end())
  27. return map[code];
  28. return std::string::npos; // строки нет, или же ""
  29. }
Add Comment
Please, Sign In to add comment