Skip to Content
Absolute Beginner's Guide to Programming, Third Edition
book

Absolute Beginner's Guide to Programming, Third Edition

by Greg Perry
November 2002
Beginner content levelBeginner
432 pages
11h 44m
English
Que
Content preview from Absolute Beginner's Guide to Programming, Third Edition

C Operators

Many of C's operators, such as the plus sign, work exactly like those in other languages. Nevertheless, C's rich collection of operators requires some review so that you can grasp what C is all about. This section provides a quick overview of some of C's more interesting operators.

C supports increment and decrement operators. In Chapter 12, “Program Algorithms,” you learned about the concept of adding or subtracting 1 (one) to or from a variable to keep track of a count. C's ++ and -- operators add and subtract 1, respectively, from whatever variable you apply them to. The following statements add 1 to the variables a, b, and c:

a++;
b++;
c++;

The following statements decrease a, b, and c by one:

a--;
b--;
c--;

C also supports ...

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.
Start your free trial

You might also like

Absolute Beginner's Guide to Programming, Second Edition

Absolute Beginner's Guide to Programming, Second Edition

Greg Perry

Publisher Resources

ISBN: 0789729059Purchase book