you just need the ignore call after you do cin >> c_n_p;
. When you change from unformatted input to formatted input you will need to call ignore.
getline(cin, something);
cin >> foo;
cin.ignore(80, '\n'); // need this here for getline to work
getline(cin. somethingelse);
// without a cin >> you don't need anything
getline(cin, something);
getline(cin, somethingelse);
getline(cin, bar);
// no ignore here since they are all getline calls
the reason for this is that cin >> foo
leaves the newline in the input buffer where getline(cin, foo)
will extract the newline from the input buffer.