bool isReverse(string s1,string s2)
// pre : none
// post : returns true if s1 is reverse of s2 and otherwise false
{
if (s1.length() != s2.length())
{
return false;
}
int size = s1.length();
int count = 0;
else
{
for (int i = 0; i < size; i++)
{
if (s1.at(i) == s2.substr(s2.length()-i-1,1)
{
count++;
}
}
}
if (count == size)
return true;
else
return false;
}
no match for 'operator==' in '(&s1)->std::basic_string<_CharT, _Traits, _Alloc>::at [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((unsigned int)i)) == std::basic_string<_CharT, _Traits, _Alloc>::substr(typename _Alloc::size_type, typename _Alloc::size_type) const [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((unsigned int)((size - i) - 1)), 1u)'
pretty sure my logic is right?