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

Fundamental Operators

C uses operators to represent arithmetic operations. For example, the + operator causes the two values flanking it to be added together. If the term “operator” seems odd to you, please keep in mind that those things had to be called something. “Operator” does seem to be a better choice than, say, “those things” or “arithmetical transactors.” Now take a look at the operators used for basic arithmetic—=, +, -, *, and /. (C does not have an exponentiating operator. The standard C math library, however, provides a pow() function for that purpose. For example, pow(3.5, 2.2) returns 3.5 raised to the 2.2 power.)

Assignment Operator: =

In C, the equal sign does not mean “equals.” Rather, it is a value-assigning operator. The statement ...

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