How do I draw a line in the "Cin" of the iostream library?

3

How can I remove the line break when reading some variable with cin ?

#include <iostream>
using namespace std;

int main()
{
    int dia, mes, ano;
    cout<< "Data: ";
    cin>> dia;cout<<"/";  cin>> mes;cout<<"/";  cin>> ano;
    system("pause");
    return 0;
}

Compiled:

Iwantittolooklikethis:

    
asked by anonymous 06.01.2018 / 04:09

1 answer

3

Not possible. cin is made for basic use, for experimentation, minimal interaction without ceremony. If you want to have complete control over the data entry you will have to write a code that will control the way you want it, which is not easy to do right. C ++ is not a language that delivers everything ready and it is rare to have external libraries that are not very generic.

    
06.01.2018 / 11:30