It’s more useful for loops than if statements.
while( var = GetNext() )
{
...do something with var
}
Which would otherwise have to be written
var = GetNext();
while( var )
{
...do something
var = GetNext();
}
More Related Contents:
- Why is my c != ‘o’ || c != ‘x’ condition always true? [duplicate]
- Gnuplot: conditional plotting ($2 == 15 ? $2 : ‘1/0’) with lines
- Can I use conditional statements with EJS templates (in JMVC)?
- Why would a language NOT use Short-circuit evaluation?
- Custom Weighted Scale [closed]
- What is dependency injection?
- Why are floating point numbers inaccurate?
- Why not use exceptions as regular flow of control?
- How to assign from a function which returns more than one value?
- What’s the difference between an argument and a parameter?
- How to explain callbacks in plain english? How are they different from calling one function from another function?
- Pass by reference or pass by value? [closed]
- Why are relational set-based queries better than cursors?
- When is it okay to check if a file exists?
- Shortest way to check for null and assign another value if not
- Random floating point double in Inclusive Range
- Why is Math.pow(0, 0) === 1?
- Compute rank of a combination?
- Why should I use foreach instead of for (int i=0; i
- Efficiently selecting a set of random elements from a linked list
- While destructuring an array, can the same element value be accessed more than once?
- How to make a copy of a 2D array in Python? [duplicate]
- Greater Than Condition in Linq Join
- Path generation for non-intersecting disc movement on a plane
- “or” conditional in Python troubles [duplicate]
- How to design extensible software (plugin architecture)? [closed]
- Conditional JOIN Statement SQL Server
- Tournament bracket placement algorithm
- Should I use composite primary keys or not?
- String Compare “Logic”