diff --git a/StackVclient.cpp b/StackVclient.cpp index 693bf5d..881086d 100644 --- a/StackVclient.cpp +++ b/StackVclient.cpp @@ -1,26 +1,26 @@ #include #include -#include "StackV.h"//Use vector implementation of Stack +#include "StackV.h" //Use vector implementation of Stack using namespace std; -string reverseString(string str) +string reverseString(const string& str) { - string res; - Stack stk; - - for (auto ch : str ) - stk.push(ch); + string result; + Stack stk; + + for (auto ch : str ) + stk.push(ch); while( stk.size() > 0) - { - res += stk.top(); - stk.pop(); - } + { + result += stk.top(); + stk.pop(); + } - return res; + return result; }