I'd like to preface this by saying I am new to programming but I am working on a little project and have everything figured out except this one little part, I can't find it online and can't think it through for whatever reason. I need to display a string backwards but the way I have coded it, it displays each character on a new line. I want to display it on the same line. If I add an endl to the end it has the "Press any key to continue..." message which I do not want.
if (sel == 4)
{
for (a = sent.length() - 1; a >= 0; a--)
{
cout << sent.at(a) << endl;
}
break;
}
So essentially, the user inputs a string, I store it as "sent", then they are asked to enter a selection which is stored as "sel" 1 through 4, each does something different to the string (uppercase, lowercase, etc) but 4 will display it backwards, it works now, but when it displays the string, the message "Press any key to continue..." appears (as it should) I just can't figure out a way around it.