Hey Fellas,
I was wondering if I could write a simple code that erases the input display information once a user enters it. For example, I was going to write a simple program that asks for the user's name and then have the trailing display information erased from the program. Here's the code that I wrote:
Code:
#include <iostream>
using namespace std;
int main ()
{
char name [10];
cout << "May I have your name please?" << endl;
cin >> name;
cin.ignore();
cout << "Hey, " << name;
cin.get();
return 0;
}
When the user enters their information their screen would look like this:
May I have your name please? You
Hey, You
....so my question basically is how do I get rid of "May I have your name please?" so that it looks like this on their screen:
Hey, You
____
Thanks in advance!