cin.getline vs getline(cin) code example
Example 1: cin.getline
cin>>n;
cin.ignore();
cin.getline(cin,string,'\n');
Example 2: getline vs cin.getline
getline(cin, variable_name, '\n');
cin>>n;
cin.ignore();
cin.getline(cin,string,'\n');
getline(cin, variable_name, '\n');