posted 13 years ago
I have this text file- xanadu.txt
In Xanadu did Kubla Khan
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea.
I can use this Char Stream program to copy it to thatone.txt:
Now, if I want the variable x or the life.read() value printed, something goes wrong. I get this output in thatone.txt
I aauddKbaKa
ttl lauedm ere
hr lh h ardrvr a
hog aen esrls omnDw oasnessa
What I am wondering is why printing the values for x and life.read() seem to change them?
In addition, if I don't use what appears to be the redundant variable x on lines 9-10 I have this code:
That yields this result:
nXnd i ul hnAsaeypesr-oedce:WeeAp,tesce ie,rnTruhcvrsmaueest a
ont uls e.
I am just curious why these things should be important.