I read that this form of getline:
getline(char *buf, streamsize num)
But I recently came across this getline function:
getline(cin,x);
where x
is a string
.
How is this ?
I read that this form of getline:
getline(char *buf, streamsize num)
But I recently came across this getline function:
getline(cin,x);
where x
is a string
.
How is this ?
The first one is a member function of std::istream
. And the second one is a free standalone function. You've overloaded functions for both.
The former is a member function of basic_istream
.
The later is a free function.