what am I doing wrong with this string?

void sequence (string str1)
{
char recent = str1[0];
cout << recent;
for (int i = 1; i < str1.length(); i++)
{
if str1[i] > recent
{
cout << str1[i];
recent = str1[i];
}
}
}


I am getting "syntax error identifier str1" at line:
if str1[i] > recent
Last edited on
If condition goes between brackets (), cout requires the << operator.
yup found em both. boy does my username suit me somedays xD. Thanks for the pointouts! Closing topic.
Topic archived. No new replies allowed.