I\'m creating a simple console application in C++ that gets string and char inputs from the user. To make things simple, I would like to use the string and
std::cin.ignore() will ignore the first character of your input.
std::cin.ignore()
For your case, use std::cin.ignore() after std::cin and then getline() to ignore newline character as:
std::cin
getline()
cin>>ch; cin.ignore(); //to skip the newline character in the buffer getline(cin,var);