when im entering data to this part of the program it runs fine but after i enter the vehicles rego number it will skip input for the fuel level. but if i enter only 1 character for the rego number i can enter fuel level.
rego numbers consist of numbers and letters so i made it a string.
i think the input is being skiped because if i enter in data that goes over the string size limit but i dont know alot about bits.
char regoNumber[7]; // <- from struct
cout << "enter the vehicle's age ";
cin >> temp.vehicleAge;
while( temp.vehicleAge >= 9999 || temp.vehicleAge <= 1000 )
{
system("CLS");
cout << "Error: age too short/too Long! must be 4 digits" << endl
<< "if there is no age enter '1234' " << endl;
cin >> temp.vehicleAge;
}
cout << "enter the rego number ";
cin >> temp.regoNumber[6];
cin.ignore();
cout << "enter current fuel level ";
cin >> temp.fuelLevel;
//cin.ignore();
while( temp.fuelLevel > 100 && temp.fuelLevel < 1 )
{
cout << "ERROR: fuel level must be between 1 and 100" << endl
<< "if fuel is at half enter 50, if full tank enter 100";
cin >> temp.fuelLevel;
cin.ignore();
}
cout << "enter price paid from supplier ";
cin >> temp.priceBrought;