Understanding Function Templates in C++

Understanding Function Templates in C++

By using function templates, you avoid any code duplication in your program. For example, one function template can be used to find the maximum value between different types

Understanding Smart Pointers in C++

Understanding Smart Pointers in C++

One of the main responsibility as a programmer is to ensure that your application is not leaking memory. Many OOB languages provides a garbage collector which makes sure that no leakage occurs.

How to use Forward Declaration in C++

How to use Forward Declaration in C++

Imagine that you have two classes: MyClassA and MyClassB. Both of these classes have their respective .h and .cpp file. However, you need to reference MyClassA in MyClassB, do you know where you should use #include "MyClassA.h"  as opposed to class MyClassA in the files of MyClassB?

Traversing containers the smart way in C++

Traversing containers the smart way in C++

So what are Iterators? Iterators are an efficient method provided by C++ to traverse the elements of any type of containers such as: Vectors, Deques, Lists, etc. An iterator represents a certain position in a container.

A cooler way to do For-loops in C++

A cooler way to do For-loops in C++

There is a new type of for-loop in C++ 11 that you may want to give it a try. In my opinion is more clean and efficient, but you should decide yourself.