1. ## Simple Explanation Needed

When something like this is done in C:

Code:
```int i;
const static char phase[] = "urrrddd";

for (i = 0; phase[i]; i++)
{
/* some code */
}```
is phase[i] a shorter way of saying: phase[i] != 0
or something else? Thanks

2. Pretty much.

3. When you don't specifiy a condition it evaluates to true if it is different than zero so phase[i] and phase[i]!=0 are the same thing when already compiled.

And that loop will run while the string isn't terminated.

4. Boolean expressions in C are numerical expressions as well, and they are resolved in the following way: Every number and expression that results to a non-zero value is true, while every expression that results to zero is false.

5. Perfect, thank you for all the explanations.

One more simple question that is similar.

Code:
```int multi_tile, norec, opt_DM;

/*some code*/

multi_tile = norec && opt_DM < 32;```
For the code above, is there a long way of coding that last line...maybe with an if statement? I'm trying to get a better idea of how '&&' and '<' are being used to give the value of multi_tile. Thanks for the help

6. Originally Posted by slowcoder
Perfect, thank you for all the explanations.

One more simple question that is similar.

Code:
```int multi_tile, norec, opt_DM;

/*some code*/

multi_tile = norec && opt_DM < 32;```
For the code above, is there a long way of coding that last line...maybe with an if statement? I'm trying to get a better idea of how '&&' and '<' are being used to give the value of multi_tile. Thanks for the help
multi_tile will be 1 only if norec is different than zero and opt_DM is less than 32.

if those conditions are not true multi_tile will be zero.

Boolean expresions evaluate to 1 or 0, indicating true and false.

7. So just to verify that I interpreted that properly, this would be the equivalant?

Code:
```int multi_tile, norec, opt_DM;

/*some code*/

if ((norec != 0) && (opt_DM < 32))
multi_tile = 1;
else
multi_tile = 0;```
Thank you Govalant!

8. Exactly =)