Add extract char operator to istream

This commit is contained in:
drmortalwombat 2024-02-26 18:22:21 +01:00
parent e2f822e7d1
commit 148c288942
2 changed files with 8 additions and 0 deletions

View File

@ -952,6 +952,13 @@ istream & istream::operator>>(float & val)
return *this; return *this;
} }
istream & istream::operator>>(char & val)
{
doskipws();
val = get();
return *this;
}
istream & istream::operator>>(char * p) istream & istream::operator>>(char * p)
{ {
doskipws(); doskipws();

View File

@ -124,6 +124,7 @@ public:
istream & putback(char c); istream & putback(char c);
istream & unget(void); istream & unget(void);
istream & operator>>(char & val);
istream & operator>>(bool & val); istream & operator>>(bool & val);
istream & operator>>(int & val); istream & operator>>(int & val);
istream & operator>>(unsigned & val); istream & operator>>(unsigned & val);