char name[20];
char fakename[20];
cout<<"Enter your name\n";
cin.get(name,20); // why does this print my name then let the program stop without asking me for my second name ?
cout<<"second name\n";
cin.get(fakename,20);
cin.get() will grab the input (ignoring leading whitespace) until the first whitespace character, cin.getline() will get the input until the first newline character.
So, if you typed in "Vallius Dax" and hit enter, then your cin.get() at line 4 would grab Vallius, your cin.get() at line 6 would grab Dax and the program would continue.
char name[20];
char fakename[20];
cout<<"Enter your name\n";
cin.get(name,20); // why does this print my name then let the program stop without asking me for my second name ?
cin.ignore();//<<<<<<<<<<<<<
cout<<"second name\n";
cin.get(fakename,20);
get() method from the istream class reads until it bumped to the new-line character, but does not store it
and it is left in the buffer... then, when second name should be typed, method looks into the buffer if there is something to be taken, a there it is - new-line character from previous reading. And as I mentioned, get() stops reading when '\n' occures, so it looks like second name was skipped, but it just reads '\n' from buffer and stops