input stream

Hello all.
I have a question.
I am watching Stanford CS106B C++ class on YouTube.
But there is something very confusing.
The professor uses the input stream function get(char) without passing a
char to the function.
Like this:
ifstream infile ;
int ch = infile.get();
Shouldn't be like this:
infile.get(char_type);
please clarify.
Thank you.
std::istream::get() is overloaded.
http://en.cppreference.com/w/cpp/io/basic_istream/get

int ch = infile.get(); overload (1) int_type get();

infile.get(char_type); overload (2) istream& get( char_type& ch );
Thank you
Topic archived. No new replies allowed.