Key Concepts
The loop is a powerful programming tool. You should pay particular attention to three aspects when setting up a loop:
Clearly defining the condition that causes the loop to terminate
Making sure the values used in the loop test are initialized before the first use
Making sure the loop does something to update the test each cycle
C handles test conditions by evaluating them numerically. A result of 0 is false, and any other value is true. Expressions using the relational operators often are used as tests, and they are a bit more specific. Relational expressions evaluate to 1 if true and to 0 if false, which is consistent with the values allowed for the new _Bool type.
Arrays consist of adjacent memory locations all of the same type. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access