Getting chars from cin.

Oct 22, 2014 at 11:40pm
I'm trying to extract characters from a file in a project I'm working on. The only problem is that there doesn't seem to be any method in ifstream (or istream for that matter) that returns chars. What am I overlooking?
Oct 23, 2014 at 1:02am
You can use the cin.get() function, with the exception of doing it like this:

1
2
3
ifstream infile;
/...
char a = infile.get()


http://www.cplusplus.com/reference/istream/istream/get/

This above is an example about it also.
Topic archived. No new replies allowed.