Tag Archives: functions

Learn Finance C++, Lesson 42, Function templates explained

On our way towards the Standard Template Library, we explain function templates, how to build them, and why they are useful. https://andyjamesduncan.wordpress.com Code block: // main.cpp #include <iostream> using namespace std; template <class ALPHA, class BETA> ALPHA addNums(ALPHA inpOne, BETA … Continue reading

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

Learn Finance C++, Lesson 21, References, aliases to variables, and references with functions

Before we move on further with pointers, we also have to uncover another dark C++ secret, and that is references, which are similar to pointers, but different. Here, we examine how to set up a reference, and the kinds of … Continue reading

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

Learn Finance C++, Lesson 4, Functions and comments

To start moving towards object orientation, rather than spaghetti code, we introduce functions conceptually and also a couple of very simple real examples. In passing we mention comments and the two main ways of adding comments to C++ code. https://andyjamesduncan.wordpress.comContinue reading

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