Week 13 - More about classes
| C++ Study w/e 17 Feb 2008 | |
| Week #: |
13
|
| Week Hours: |
7.1
|
| Total Hours: |
141.4
|
Another 'plugging away at it' type week. Not that many hours spent studying, only seven hours spread over five days. Nonetheless, I'm still making progress and not getting too far ahead of myself which is quite easy to do when self-studying. I would prefer to put more time in but there are other things to do.
This week (Week # 13) I continued with Chapter 11 from the book, C++ Primer Plus, Fifth Edition, and currently at the programming exercises at the end of the chapter.
In particular this chapter introduced the 'Overloading Operator' either as a class member or friend function. Effectively accounting for situations where 'answer = class + primitive' (member function) which, mathematically, is the same as 'answer = primitive + class' (friend function). Mathematically they are the same but under C++ in order to be in sync with mathematics both versions have to be accounted for ie. coded.
In explanation and clarification of the above, user created vector classes were introduced. These vector classes incorporated both the polar and rectangular co-ordinate system. This aspect alone gave me a heap of ideas on how to eventually write my own running/fitness program which will incorporate GPS mapping.
The chapter finished off with an explanation and examples of 'Automatic Conversion' and 'Type casts for Classes'.
Next week, obviously, I'll continue with the programming exercises, hopefully finish them. A while ago I wrote a simple program which converts distance and time to pace (a runner's utility). This was written (coded) prior to studying classes. I'm thinking of revisting that code, convert to classes and include other little bits I've since learnt.
Anyway, that was the week that was.
- Steve's blog
- Login or register to post comments
- 177 reads


Recent comments
4 hours 21 min ago
1 day 4 hours ago
1 day 9 hours ago
1 day 20 hours ago
1 day 20 hours ago
3 weeks 6 days ago
3 weeks 6 days ago
4 weeks 5 hours ago
10 weeks 1 day ago
11 weeks 5 days ago