can '\b' negate '\n'?

Hello,
Reciently I started messing with '\b'. If you look at some of my other posts one of them is about making a text-based progress bar the refreshes and stays in the same spot. Pretty cool to me. Anyways, I am making a bit bigger project this time, and am looking to know if '\b' and move the cursor up a line... The answer I found was no, how would you do this? Here's a small program to prove it won't.

1
2
3
4
5
6
7
8
9
10
// can '\b' negate '\n'?
#include <iostream>
using namespace std;

int main()
{
	cout << "\n\n\bHi\t\bhi";

	return 0;
}


Any ideas? This outputs:


Hi hi

Thanks for taking a look,

enduser000
Last edited on
\b only moves the caret back one space if possible, but you already know that. I do not think that there is a "reverse newline" character that you can print however, so you would probably need to use a console function that is likely OS-dependent.
Thanks for the reply. I have used the command 'system("cls")'. It works effectivly.

enduser000
Topic archived. No new replies allowed.