Tag Archives: Object

Learn Finance C++, Lesson 40, Passing objects by value, reference, and pointer

There are three main ways to pass an object to a function. In this lesson, we examine all three, including passing by value, by reference, and by pointer. We discuss the pros and cons of each method. The recommended method … Continue reading

Posted in C++, Programming | Tagged , , , , , , , , | Leave a comment

Learn Finance C++, Lesson 34, Inheritance, Part II

Today we’ll finish off the DurationBond class, by calculating a duration for the input bond details. https://andyjamesduncan.wordpress.com Finished code blocks: // DurationBond.h #ifndef __AndysPointers__DurationBond__ #define __AndysPointers__DurationBond__ #include <iostream> #include “Bond.h” using namespace std; class DurationBond : public Bond { public: … Continue reading

Posted in C++, Programming | Tagged , , , , , , , | Leave a comment

Learn Finance C++, Lesson 33, Inheritance, Part I

We begin the first part of class inheritance by borrowing from our Bond class (the underlying or base class) and generating a new DurationBond class (the derivative or derived class). This new class gets to use all of the features … Continue reading

Posted in C++, Programming | Tagged , , , , , , , | Leave a comment