i typed a function to enter data into a file to be recalled later, now i have done something here and as soon as this function begins it skips the first 'zips' getline and makes it a blank space and goes directly to 'city' - someone please tell me what the hell happenned here - g'day - mark
void addData()
{
string zips = "";
string city = "";
ofstream outFile;
outFile.open("citiesandzips.txt");
if(outFile.is_open())
{
cout << "Enter ZIP Code (X to stop): " << endl; ///this is my problem - this bastard doesnt take data it automatically fills out as a blank space
getline(cin,zips);
transform(zips.begin(), zips.end(), zips.begin(), toupper);
while (zips != "X")
{
cout << "Enter City: " << endl;
getline(cin,city);
outFile << zips << '#' << city << endl;
cout << "Enter ZIP Code (X to stop): ";
getline(cin,zips);
transform(zips.begin(), zips.end(), zips.begin(), toupper);
}
outFile.close();
}
else
cout << "The file could not be opened." << endl;
}