Palindrome phrase instantiated from here error c++

I am struggling with this code. I know what I want to do, but I don't understand why I am getting an "instantiated from here" error. My code is supposed to be taking an input of a phrase including any spaces or punctuation and remove the spaces and punctuation to return whether or not the phrase is a palindrome.

bool isPhrasePalindrome (string phrase)

unsigned short k=0;
unsigned loop = 0;

for (loop =0; loop < (phrase.length()); loop++)
if (ispunct (phrase[loop]) || isspace (phrase[loop]))
phrase.erase(loop,1);

for (k = 0; k < (phrase.length()/2); k++)
if (tolower(phrase[k]) != tolower(phrase[(phrase.length()-1-k]))
return false;

return true;
You forgot to enclose in curly braces the body of the function.
Sorry about that.

#include <iostream>;
#include <cctype>;

using namespace std;

bool isPhrasePalindrome (string phrase);

int main(void)

char run_program;
string input_word;
bool palin;

do
palin = false;
cout << "\nPlease enter your phrase to check: ";

getline(cin,input_word);
cout << endl;

palin = isPhrasePalindrome(input_word);

if (palin)
cout << "The phrase is a palindrome";
else
cout << "The phrase is not a palindrome";

cout << "Do you have another phrase to check? ";
cin >> run_program;
cin.ignore(INT_MAX,'\n')

while (tolower(run_program) == 'y');

return 0;

Topic archived. No new replies allowed.