10
I was fixing the white space problem with the getline
only that I came across this problem where the question "Type the employee name:" is skipped, how to solve this?
Is it because I’m using cin
and getline
in the same program? Because only with the cin << nomeFuncionario;
I don’t have this problem.
cout << "\n\nDigite o nome da empresa: ";
getline (cin,nomeEmpresa);
cout << "\n\nNúmero de funcionários: " ;
cin >> n;
cout << "\n\nDigite o nome do funcionário: ";
getline (cin,nomeFuncionario);
cout << "\n\nDigite o número de horas trabalhadas: ";
cin >> horasTrabalhadas;
I think this reading is essential for those who are starting in c++ and want to understand a little more about data input and output. https://pt.wikibooks.org/wiki/Programar_em_C%2B%2B/Entrada_e_sa%C3%ADda_de_dados
– Marcelo T. Cortes