Top "Istream" questions

In C++ std::istream is the base class for input streams.

Using C++ filestreams (fstream), how can you determine the size of a file?

I'm sure I've just missed this in the manual, but how do you determine the size of a file (in …

c++ filesize fstream istream
How to detect empty lines while reading from istream object in C++?

How can I detect if a line is empty? I have: 1 2 3 4 5 I'm reading this with istream r so: int n; …

c++ string input stream istream
Get an istream from a char*

I have a char* and the data length that I'm receiving from a library, and I need to pass the …

c++ istream
Reading binary istream byte by byte

I was attempting to read a binary file byte by byte using an ifstream. I've used istream methods like get() …

c++ binaryfiles istream
Skip lines in std::istream

I'm using std::getline() to read lines from an std::istream-derived class, how can I move forward a few lines? …

c++ istream
istream::getline return type

What does the istream::getline method return? I am asking because I have seen that to loop through a file, …

c++ file-io ifstream getline istream
Why does std::getline() skip input after a formatted extraction?

I have the following piece of code that prompts the user for their name and state: #include <iostream> #…

c++ input iostream istream c++-faq
Find the end of stream for cin & ifstream?

I'm running myself through a C++ text book that I have as a refresher to C++ programming. One of the …

c++ ifstream eof cin istream
Why is istream/ostream slow

At 50:40 of http://channel9.msdn.com/Events/GoingNative/2013/Writing-Quick-Code-in-Cpp-Quickly Andrei Alexandrescu makes a joke about how not efficient/slow istream …

c++ performance ostream istream
What's the difference between getline and std::istream::operator>>()?

#include <iostream> #include <string> using namespace std; int main() { string username; cout<< "username" ; cin &…

c++ cin istream