From the course: C Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Challenge: Non-member operators

Challenge: Non-member operators - C Tutorial

From the course: C Essential Training

Challenge: Non-member operators

(upbeat electronic music) - [Educator] The challenge for this chapter is for you to implement non-member operators for the rational class from this chapter. This is zero seven challenge.CPP from chapter seven of the exercise files. This is the rational class from earlier in this chapter. And the first thing you'll notice about this file is that it doesn't compile. As we learn in this chapter, the expressions in these lines require non-member operators. Your task is to modify this class to use non-member functions for the arithmetic operators so that these four lines of code work properly. This challenge should take about 15 minutes to an hour. As always feel free to take your time and experiment. I'll show you my solution in the next movie.

Contents