Article View: comp.lang.java.api
Article #9Re: Strange I/O behavior
From: MWRon
Date: Thu, 07 Dec 2000 00:00
Date: Thu, 07 Dec 2000 00:00
23 lines
1573 bytes
1573 bytes
In article <ejalbert-B35454.10542507122000@nntp.stanford.edu>, Eric Albert
<ejalbert@stanford.edu> wrote:
>Your code won't do the right thing in C and won't compile in Java, but
>it's the right idea. :) I think this is what you meant:
> while((char) ch != '\n' && (char) ch != '\r' && ch > -1)
>In C, the ('\n' || '\r') will evaluate to 1, so you'd get while(ch != 1
>&& ch > -1), which ain't quite what you're expecting. :)
<slapping forehead> that is what I get for trying to think with verifying
anything.
Thanks for the catch.
Ron
--
CodeWarrior PersonalJava Edtion
The speed, integration, and flexibility of the product are truly impressive.
Java Report Online
http://www.javareport.com/html/from_pages/product_review.cfm?articleID=1616
Metrowerks "Software Starts Here" MWRon@metrowerks.com
Technical Details
Message-ID:
<mwron-0712001551010001@c243286-a.bcreek1.mi.home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<mtobin-99A222.22175206122000@news.earthlink.net> <mwron-0712001211280001@c243286-a.bcreek1.mi.home.com> <ejalbert-B35454.10542507122000@nntp.stanford.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fecd1,139b3b33219ebf5 X-Google-Attributes: gidfecd1,public X-Google-Thread: f635e,139b3b33219ebf5 X-Google-Attributes: gidf635e,public X-Google-Thread: 10bcce,139b3b33219ebf5 X-Google-Attributes: gid10bcce,public From: mwron@metrowerks.com (MWRon) Subject: Re: Strange I/O behavior Date: 2000/12/07 Message-ID: <mwron-0712001551010001@c243286-a.bcreek1.mi.home.com> X-Deja-AN: 702323174 References: <mtobin-99A222.22175206122000@news.earthlink.net> <mwron-0712001211280001@c243286-a.bcreek1.mi.home.com> <ejalbert-B35454.10542507122000@nntp.stanford.edu> Organization: Metrowerks Newsgroups: comp.lang.java.api,comp.sys.mac.programmer.codewarrior,codewarrior.mac