I've tried to use std::getline()
in my program twice, but it doesn't work the second time I use it. Can someone help?
string bufName; //Made a string for Name
int age; //Age will be entered in form of integer, if not the program won't crash
float temperature; // it's in float format because it can have a lot of decimal points
string bufCity; // Name of the city can be two words like San Francisco so we used Buf for it
cout << "Enter your Name please: " << endl;
getline(cin, bufName); // Using Get line to read multiple String in a line
cout << "you Entered: " << bufName << endl;
cout << "Enter your Age: " << endl;
cin >> age ;
cout << "you Entered: " << age << endl;
cout << "Enter the Temperature at your city please: " << endl;
cin >> temperature ;
cout << "you entered: " << temperature << endl;
cout << "Enter your Name please: " << endl;
getline(cin, bufCity); // Using Get line to read multiple String in a line
cout << "you Entered: " << bufCity << endl;