I'm having trouble with my C++ assignment because when I run the program I can't type more than one word on the "Enter your street name" line or it won't work. My teacher said something about "getline" but he really lost me. Here is what I have. Please help!
#include <iostream>
#include <string>
using namespace std;
int main () {
string fname, lname;
int age;
char gender;
string snumber, sname;
string city;
string state;
int zip;
cout << "Enter your first name : ";
cin >> fname ;
cout << "Enter your last name : ";
cin >> lname ;
cout << "Enter your gender <M/F> : ";
cin >> gender ;
cout << "Enter your age : ";
cin >> age ;
cout << "Enter your street number : ";
cin >> snumber ;
cout << "Enter your street name : ";
cin >> sname ;
cout << "Enter the name of your city : ";
cin >> city ;
cout << "Enter the name of your state : ";
cin >> state ;
cout << "Enter your zip code : ";
cin >> zip ;
cout << " NAME : " << lname << ", " << fname << endl;
cout << " AGE : " << age << endl;
cout << " ADDRESS : " << snumber << " " << sname << endl;
cout << " CITY : " << city << endl;
cout << " STATE : " << state << endl;
cout << " ZIP : " << zip << endl;
system("pause");
}