Hi,
I'm an absolute beginner in Visual C++ (Express Edition 2010). I've just been trying out this very simple program, and I can't get to use the '\b' tag like I did when I used Turbo C++ v4.5. The cursor moves backwards, but the text does not get erased, as it did with Turbo C++.
The code is:

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
	cout<<"Hello";
	cout<<"\b\b";
	_getch();
}

The output is
Hello
(Underline represents cursor position).
What am I doing wrong? Any help would be appreciated.

I've never used Turbo C++, but you can get similar results by moving the cursor backwards, and then replacing the letters with white spaces.

std::cout << "2 + 2 = 4\b5" << std::endl; // replaces 4 to 5
std::cout << "erase\b\b  " << std::endl; // replaces "se" with white spaces
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.