hi all
I'm trying to read a document char by char
my question is how do I read the spaces as well?
Thank you!
alexhkleung
0
Newbie Poster
Recommended Answers
Jump to PostThis code with print all the characters from any file to the console.
#include<iostream> #include<fstream> using namespace std; const char fileName[] = "FILENAME"; int main() { ifstream in(fileName, ios::in | ios::binary); while (in) { cout << (char) in.get(); } system("pause"); return 0; }
All 4 Replies
William Hemsworth
1,339
Posting Virtuoso
alexhkleung
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
alexhkleung
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.