[prog] Re: Programming Digest, Vol 3, Issue 21

Guru - haunter03 at hotmail.com
Sat May 31 13:36:18 EST 2003


> > And that weird command, <?   I see that
> > it's short for
> > result = result < 100 ? 100 : result
> > which is a lot better way to do it
>
>i've never heard of that... where'd you hear about that?

Can you do it like that?
The command does exist, I've seen it in my C book (1st year CS student).
As far as I know wouldn't it be (a new example):
result < 100 ? result++ : result--

That pointless piece of code I just created should, if the result is less 
than 100 add 1 to result and if its greater than 100 it will take 1 away 
from result.

I believe that the command is simply short for a very simple if-else 
statement.

Is that correct?

_________________________________________________________________
ninemsn Extra Storage is now available. 30MB of storage on ninemsn Groups - 
great for sharing photos and documents. Go to  
http://join.msn.com/?page=dept/home&pgmarket=en-au



More information about the Programming mailing list