Im new for C ++, so endl is used to end the line as
cout << "Hello" << endl;
My research on the Internet tells me that this is a function, if so, why we can call it without using "();"
How to declare such a function, suppose I want to make a function that just picks up the console every time I ask for input like
string ain() { return " : ?"; }
now instead of using it every time like this
cout << "Whats your name " << ain();
I want to use it as
cout << "Question " << ain;
Just like endl, I know that "()" is not so much, and in fact it does nothing huge to save a ton of load time, but I basically ask this question to find out why endl can do this to do.
source share