Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > istream alterin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 43621 of 47926
Post > Topic >>

istream altering text

by dohboy <dohboy@[EMAIL PROTECTED] > Mar 1, 2008 at 02:48 PM

a kinda newbie here.
I've done a simple little program that reads a text file and counts the
number of lines and words.
I had a heck of a time getting it to count properly when I finally
discovered the problem was not my coding, but the istream altering the
incoming text.
What I was doing was checking each incoming character (seekg) and
comparing it to a 'h0a' . What I found was that text files end their lines
with a '0d' (CR) and a '0a' (line feed). However, it was reading them off
the istream as both being '0a'. It had changed the CR.
My questions are, Is there any other little istream quirks like this I
should be aware of? And is there some way to set the stream to not alter
what is read?
TIA
-doh
 




 4 Posts in Topic:
istream altering text
dohboy <dohboy@[EMAIL   2008-03-01 14:48:30 
Re: istream altering text
"Alf P. Steinbach&qu  2008-03-02 00:57:52 
Re: istream altering text
Ian Collins <ian-news@  2008-03-02 13:13:55 
Re: istream altering text
"Ron AF Greve"   2008-03-02 01:25:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 18:11:27 CDT 2008.