In C++ std::istream is the base class for input streams.
Questions tagged [istream]
696 questions
-3
votes
1 answer
How to read integers from a line in C++?
I want to read integers in a line from a file.
For example the line is : 3/2+5-5
I think I need to use >>, but it stopped because of the characters;
I also try to use other functions, but they are all for characters.

Jutta
- 513
- 5
- 13
-3
votes
1 answer
Can't understand C++ references and istream?
istream& read_hw(istream& in, vector& hw)
{
if(in){
hw.clear();
double x;
while (in >> x)
hw.push_back(x);
in.clear;
}
return in;
}
Can someone please explain this code to…
-3
votes
1 answer
Why C++ compiler doesn't provide overloaded inserter & extractor functions for class?
Consider following program.
#include
using std::ostream;
using std::cout;
using std::istream;
using std::cin;
class three_d {
int i,j,k;
public:
three_d(int a,int b,int c) : i(a),j(b),k(c)
{ }
//friend…

Destructor
- 14,123
- 11
- 61
- 126
-3
votes
3 answers
Istream to string conversion with \n characters in C++
how can I convert istream to string, when my istream also includes newline characters and I don't want to escape whitespaces?
Thank you.

P.N.
- 341
- 3
- 16
-3
votes
1 answer
How to take istream pointer as parameter and use it in a function?
I have a function getToken, I want to pass it an istream to read from and use it. Here is given code. Please help me understand how to work with the istream pointer when passed as parameter.
Token getToken(istream *br, string& lexeme){
return…
-4
votes
1 answer
Excel to C++? Won't Work, EVERY online youtube Tut works for them, they don't work for moi
read Excel w/ C++ (microsoft vis studio)
See tutorial:
https://www.youtube.com/watch?v=EjJY7yA5SWw
Here's my code:
*ifstream FILE("USE THIS FILE.xls");
//
string date; string companyTicker; string companyName; int year1; int…

TheFemaleHessian
- 27
- 4