You could try something like:
char ch;
fstream fin("file", fstream::in);
while (fin >> noskipws >> ch) {
cout << ch; // Or whatever
}
More Related Contents:
- Difference between opening a file in binary vs text [duplicate]
- counting the number of lines in a text file
- How do I rename a file with a string using the rename() function (c++)? [closed]
- How to extract a multiline text segment between two delimiters under a certain heading from a text file using C++ [closed]
- Odd error: ‘FILE *’ differs in levels of indirection from ‘FILE’ [closed]
- Extracting text OpenCV
- Fastest way to check if a file exists using standard C++/C++11,14,17/C?
- tellg() function give wrong size of file?
- “\n” or ‘\n’ or std::endl to std::cout? [duplicate]
- For every character in string
- How to remove certain characters from a string in C++?
- Read Unicode UTF-8 file into wstring
- Create a directory if it doesn’t exist
- Mirroring console output to a file
- How to embed a file into an executable?
- c++ Read from .csv file
- What is the most elegant way to read a text file with c++?
- Convert a single character to a string?
- How to update a printed message in terminal without reprinting
- C++ class header files organization
- c++ template and header files [duplicate]
- How do I draw text with GLUT / OpenGL in C++?
- Read file names from a directory
- std::fstream buffering vs manual buffering (why 10x gain with manual buffering)?
- Open QFile for appending
- How to read huge file in c++
- C++: Where does the ofstream class save the files to?
- Is it possible to use threads to speed up file reading?
- How to write an object to file in C++
- Why does wide file-stream in C++ narrow written data by default?