4. Operators

Overview

This chapter presents a variety of operators provided by C++ describing what they do, and how they can allow us to manipulate our data. By the end of this chapter you will be able to describe and use various arithmetic, relational, and assignment operators. We'll then look at unary and logical operators, before ending with overloading operators for use with custom types. The chapter will close with a popular programming exercise, Fizz Buzz, that will implement the operators covered in the chapter.

Introduction

In the last chapter, we learned about the various data types provided by C++, and how we can use them to store and represent the data within our systems. In this chapter, we will take a look at operators, the ...

Get The C++ Workshop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.