In the following function it works fine the first time through the loop but on the second pass instead of outputting "Employees name : " and waiting for the input it outputs "Employees name : Payrate : " and waits for that output.
Why is it skipping the name input please?
Code:int GetInfo() { char name[256]; float rate; float hours; for (int x(0); x<6; x++) { cout<<"Employees name : "; cin.getline (name,256); //employee.at[x]=name; cout<<"Payrate : "; cin>>rate; //payrate.at[x]=rate; cout<<"Hours worked : "; cin>>hours; //hoursworked.at[x]=hours; //totalpay.at[x]=rate * hours; cout<<"Employee : "<<name<<"\n"; cout<<"Payrate : "<<rate<<"\n"; cout<<"Hours : "<<hours<<"\n"; }