Alright, so I just started getting into c++ and there's a few questions I have.
My first question is what is the difference between endl; and \n? I have seen a bit on this, but I am not understanding it.
My second question has to do with a simple code that I wrote up.
With this code, compiled and used in the cmd prompt, it allows you to enter a name and everything. However, say I enter the name of "ZezXion", it only replies with "Welcome, Z. Thank you for telling us your name!"
using namespace std;
cout << "Please type your name in and press enter..." << endl;
cin >> name;
cout << "Welcome, " << name << ". Thank you for telling us your name!" << endl;
If anyone can explain to me why this is happening, or explain the difference between endl and n, I'd appreciate it. Thanks!