swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] what does '?' operator mean


From: Cristiano Fontana
Subject: Re: [Swarm-Support] what does '?' operator mean
Date: Sat, 2 Oct 2010 15:53:54 +0200

Hello,

it is the C ``ternary operator'': http://en.wikipedia.org/wiki/%3F:
It is equivalent as:

if ( type == cold )
{
hereIsBetter = (headHere < bestHeat)
}
else
{
hereIsBetter = (heatHere > bestHeat)
}

Cristiano

Il giorno 02/ott/2010, alle ore 13.06, mohammed tayebi ha scritto:

dear all
I find this instruction in the heatbug tutorial

<code>

 hereIsBetter = (type == cold) ? (heatHere < bestHeat)
              : (heatHere > bestHeat);

</code>

but I don't know what does '?' and ':' operator  means

thnk you for your helps

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


reply via email to

[Prev in Thread] Current Thread [Next in Thread]