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