O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required