Quote:
> > > > if(expression1 && expression2)
> > > > some statement;
> > > > My question is, if expression1 is false will expression2 get evaluated at
> > > > all?
> > > No. Why do you ask that question here?
> > Why wouldn't he ask it here? It is a C question...
> I am trying to understand why someone would go to the trouble (and have the
> patience) to ask such a trivial question that could easily be answered by
> consultation to any C language textbook.
> I have a slightly hidden agenda as well by posting this reply in the newsgroup
> ....that is the general education of the infrequent readers of this group....
> that such simple questions should first be resolved privately. Or at least,
> disquise the question in sheep's clothing....for example:
> Why is C designed to require short circuit evaluation with respect to
> some operators (for instance &&) ?
> Isn't C somewhat unique in mandating short circuit evaluation for the
> logical AND (&&) operator? BASIC and FORTRAN don't do this.
> Why did the designers of C mandate the short circuit evaluation of the
> && operator?
> That way, you'll be quickly informed if your assumption is incorrect
> (you get to ask the question) and be much less likely to get "educated"
> about the nettiquete issues. You also just might learn some background
> about the C language, as well as the operational realities. But better
> by far to just read a book (you'll get the answer instantly).
While I agree a look in any C text should've cleared this up. I DO
NOT agree that simply stating the question in an overly verbose and
pretentious manner makes it somehow OK. That's akin to the old
verbage that BS that has passed thru a computer has somehow become
enobled. Poppy{*filter*}! It's still BS.
In any event as long as the poster has made some attempt to resolve
his/her own question thru traditional means, vice knee jerk reaction
to post, the question is legitimate.
regards,
H.Cross