c++ function, few q's about my function
Code:
#include <iostream>
using namespace std;
int main ()
{
string user;
string pass;
string cpass;
string em1;
string em2;
string age;
cout<<"Username: ";
cin>>user;
cin.ignore();
cout<<"Password: ";
cin>>pass;
cin.ignore();
cout<<"Confirm Password: ";
cin>>cpass;
cin.ignore();
cout<<"E-mail: ";
cin>>em1;
cin.ignore();
cout<<"Confirm E-mail: ";
cin>>em2;
cin.ignore();
cout<<"Age: ";
cin>>age;
cin.ignore();
cout<<"Details"<<"\n"<<"Username: "<<user<<"\n"<<"Password: "<<pass<<"\n"
<<"Confirm Password: "<<cpass<<"\n"<<"E-mail: "<<em1<<"\n"
<<"Confirm E-mail: "<<em2<<"\n"<<"Age: "<<age<<"\n";
cin.get();
}
This function works,
but I need to fix a few things
Question 1:
It shows "username" then I enter my username
and then it shows password, then confirm password, then email, confirm email, and finally age, how do I get these to show "all" at once?
Question 2:
How do I clear the text, that I put in? it shows all the stuff I've entered, then it displays Details blah blah and I see double of what I put in!
Question 3:
When I put in Mythic as my username
it shows password properly next, and everything works,
if I put Mythic Fr0st, it shows like this
Username: Mythic Fr0st
Password: Confirm Password:
if I put Mythic
its
Username: Mythic
Password:
Confirm Password:
how do I fix this