getline vs cin.getline code example Example: getline vs cin.getline getline(cin, variable_name, '\n');