cin.get vs cin.getline in c++
//array of character #include <iostream> using namespace std; int main(){ char ch[30],ch2[55]; //cin.get cin.get(ch,30); cin.get(ch2,55); cout << "Text1: " << ch << endl; cout << "Text2: " << ch2 << endl; //cin.getline cin.getline (ch,30); //reads all the line cin.getline (ch2,55); cout << "Text1: " << ch << endl; cout << "Text2: " << ch2 << endl; }