Review of C/C++

C and C++ are high-level programming languages that are widely used for developing system software and application software. They were developed to handle a wide variety of applications and meant to be cross platform compatible, so you only have to recompile your code on the new operating system for it to work. Of course, if…

Why are There Different Programming Languages?

There are many reasons why there are different programming languages. Evolving Technology One of the main reasons is that technology is always evolving, and as more technologies come into being and advance, we need more tools that can make use of these technologies. You might remember from previous classes with me, we’ve talked about how…

Derived Classes

You can extend almost any class you want. So once you’ve defined a base class, you just need to know enough about it, and how you want to derive from it. Considering our GenericGeometric class from before, let’s look at deriving a Circle class from it. In our header file we will have: Notice two…

Base vs Derived Classes

One of the cool things about object oriented programming is that you can derive a class from an existing class. this allows you to have most of the class built from an existing class, and not need to rewrite the whole class, only the new parts. Additionally, if the original class, called the base class…

Class Templates

Not only can you use templates for a primitive data type within functions, but also within classes. Consider the following example: The methods are similar to a non-template class, however, each method is a template itself, so you have to adjust a few things. For example, you have to specify template<typename T> before each method….