Solution
Here is the solution to the problem in the previous lesson.
We'll cover the following...
We'll cover the following...
Explanation
We applied the following changes::
- We turned
structinto aclassand kept only the necessary functions as public - With having
m_aprivate and not exposing a setter, we cannot changem_afrom the outside world, only with assignment. - We turned
getA()into a const function so that we cannot accidentally change any member in the function.