Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Q3
- {
- public:
- string& execute(string& left, string& right)
- {
- try
- {
- int leftVal = std::stoi(left);
- int secondVal = std::stoi(right);
- int result = leftVal + secondVal;
- string &rResult(*new string());
- rResult = std::to_string(result);
- return rResult;
- }
- catch (std::exception &ex)
- {
- string &rResult(*new string(""));
- return rResult;
- }
- catch (...)
- {
- string &rResult(*new string(""));
- return rResult;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement