Search code examples
c++istream

Reading from istream


How can I extract data (contents) from istream without using operator>>() ?.


Solution

  • If you want to read characters from the istream, then by using get and getline:

    std::istream::get

    std::istream::getline

    For general reading you may want to use read:

    std::istream::read