I have to create a program that uses a class Pstring derived from the STL class. The only error I am getting says that I have one unresolved external. How do I fix this? Here is my code:
#include <string>
class Pstring : public std::string
{
public:
Pstring(const std::string &text)
: std::string(text) { }
bool isPalindrome()
{
std::string::size_type len = length();
std::string::size_type half = len / 2;
for (std::string::size_type idx = 0; idx < half; ++idx)
{
if ((*this)[idx] != (*this)[len-idx-1])
return false;
}
return true;
}
};