Re: K&R 1.5.1 exercise
From: Merrill & Michele (beckjensen_at_comcast.net)
Date: 10/13/04
- Next message: Merrill & Michele: "Re: bit masking"
- Previous message: Michael Mair: "Re: Global variable declaration in headers"
- In reply to: Dan Pop: "Re: K&R 1.5.1 exercise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 13 Oct 2004 11:45:27 -0500
> >MPJ wrote:
> >Thanks all for replies. Mr. Pop is correct that his shortened version of
my
> >prog does indeed yield -1, but I liked the idea of trying to find the
> >appropriate answer with a while{}. Would Mr. Pop have the same criticism
if
> >one began the loop with Mr. Barts' (I know I got your 's' this time, but
did
> >I get the possessive correct?) INT_MIN suggestion, incremented in the
usual
> >fashion, and it were stipulated that an EOF had indeed been #defined as
an
> >int?
> Dan wrote:
> EOF is guaranteed to have the type int and a negative value. If you start
> at INT_MIN you can't miss it before reaching 0. No undefined behaviour
> in sight.
> What happens *after* you press the Return/Enter key, as I have asked you
> to do?
>
> Answer: you'll a get a 1 or 0 displayed, but you may never have
> a chance to see it, if your IDE automatically closes your console
> window after program termination. If this is the case, indeed, generate
> the EXE file and run it by hand in a standalone console window.
>
> The C beginner using K&R2 is better served by a command line compiler than
> by any kind of IDE. All the examples and exercises have been designed
> with a command line environment in mind.
>
Yeah, I missed it. The IDE was fine; the monkey running it, well .... I
can create the command line and would likely be better served by another
compiler. I'm not single-minded like George Bush in that I have single
thought in my head. I'm single-minded in that I don't change horses or
focus until I have to. MPJ
- Next message: Merrill & Michele: "Re: bit masking"
- Previous message: Michael Mair: "Re: Global variable declaration in headers"
- In reply to: Dan Pop: "Re: K&R 1.5.1 exercise"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|