header needed for cin.getline code example Example: cin.getline cin>>n; cin.ignore(); cin.getline(cin,string,'\n');