Even after all that, there’s still a bit more.
There are just a few more things we think you need to know. We wouldn’t feel right about ignoring them, even though they need only a brief mention, and we really wanted to give you a book you’d be able to lift without extensive training at the local gym. So before you put the book down, read through these tidbits.
We’ve used a few operators in this book, like the basic
/, but there are many other operators
available in C that can make your life easier.
An increment and a decrement increase and decrease a number by 1. That’s a very common operation in C code, particularly if you have a loop that increments a counter. The C language gives you four simple expressions that simplify increments and decrements:
Each of these expressions will change the value of
i. The position of the
say whether or not to return the original value of
i or its new value. For example:
What if you want one value if some condition is true, and a different value if it’s false?
if (x == 1) return 2; else return ...