I am having a little bit of a dilemma. I have an input file that can have a number 1 through 9 or a asterisk. I am treating 1-9 as a character. I don't know if there is white space or new lines. I can't use >> because I don't know if there is white space. I can't use get() because it will stop reading in characters if get encounters a new line. Could someone give me some suggestions?
nizbit
0
Junior Poster in Training
Recommended Answers
Jump to PostGenerally speaking, if you're not sure of the contents of the file, or if it may contain undesired characters, you should consider reading a line of the file into a string variable or char array, and then cleaning it up (removing leading/trailing spaces, CR/LF, etc.). Then you can look at …
Jump to PostAdditionally, you can also paste some of your file contents here, and any code you have here, we can give you better ideas on how to proceed.
All 6 Replies
mcriscolo
47
Posting Whiz in Training
stilllearning
148
Posting Whiz
nizbit
0
Junior Poster in Training
VernonDozier
2,218
Posting Expert
Featured Poster
nizbit
0
Junior Poster in Training
VernonDozier
2,218
Posting Expert
Featured 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.