DevPinoy.org
A Filipino Developers Community
jokiz » All Tags » .NET » C (RSS)

>>> First two to make 3 wins! <<<

Browse by Tags

  • The (-) operator

    I used to multiply a numeric number to -1 just to get its additive inverse (negative value for positive numbers) and I found out that the (-) operator does it implicitly. int value = 10 int negativeValue = value * -1 int negativeValueAlso = -value
    Published 04-28-2005 6:32 PM by jokiz
    Filed under: , , ,
  • Efficient For Loop

    [code language="C#"] for (int i = 0; i < collection.Count; i++) { //do something with collection } [/code] I’ve done this before and for me, the efficient way is to store the Count property of the collection rather than access it everytime for the...
    Published 03-17-2005 7:13 PM by jokiz
    Filed under: , , ,
  • Assignment in a WHILE condition

    Before, I used to think that in C, the assignment operator always evaluate to true. It is because of this context: [code language="C#"] while (intLeft == intRight) { //do whatever } [/code] If you mistyped the comparison operator (==) as a single equal...
    Published 01-17-2005 5:34 PM by jokiz
    Filed under: , , ,

Copyright DevPinoy 2005-2008