Answer the question
In order to leave comments, you need to log in
Why is the file not being read?
char simb;
while (!fm.eof()) {
fm.get(simb);
cout << simb;
rash.push_back(simb);
}
Answer the question
In order to leave comments, you need to log in
The code you provided looks correct. It doesn't output what you want due to another error. For example, the file is empty but you manually check another file.
Either the file does not open because it does not exist, or you compile via C++98.
The documentation says (note after the parameters):
If the mode has both trunc and app set, the opening operation fails. It also fails if either is set but out is not, or if both app and in are set .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question