So say I want to open a text document for reading using an instance of ifstream.open, etc.. etc... So once i open the txt file to read from it, what functions do i use to scan each character and put each character into an an array slot? Ive seen loops of if( i = 0, i < 20, i ++0) etc, but is there anyone who can walk me through it with a little more detail? Thanks
clutchkiller
3
Junior Poster
Recommended Answers
Jump to PostWhy do you want to read a character at a time? Why not use std::getline() to read a line at a time into an std::string?
Jump to PostThere are lots of tools available. You can read one char at a time aor you can read delimited text that may be stored as text or converted to numerical types. You can create code to read in a defined group of variables using a single written command. You can …
All 5 Replies
daviddoria
334
Posting Virtuoso
Featured Poster
clutchkiller
3
Junior Poster
Lerner
582
Nearly a Posting Maven
kvprajapati
1,826
Posting Genius
Team Colleague
siddhant3s
1,429
Practically a Posting Shark
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.