+ 1
Anyone know how to align the cin object so that the input can be taken a little bit right rather than the left border of cnsole?
Example: Can this be done? cout<<"Enter your age"<<endl; cin>>age; Output: Enter your age [...Input] (Display the input with three whitespace) those three dots represent three whitespace before the input Rather than the usual cout<<"Enter your age"<<endl; cin>>age; Output: Enter your age [Input] (Display the input on the left of the console) I've tried with the setw() function that sets the number of print field space with cin but it doesn't seem to work :(
2 Answers
+ 2
cout << "Enter your age" << endl << " "; // <-- Did you try adding 3 spaces to your cout?
cin >> age;
+ 1
Oow crap should've done that completely forgot about it...that worked thanks a lot :)