NULL in C++

A raw pointer is usually initialized to the value of NULL in C++: int* aNum = NULL; This indicates that the pointer aNum points to the value of 0 in most implementations. It can be thought of as a 0 in mathematics, where the length of the following vector is 0 and the direction is…

Read more NULL in C++

Timing the execution of a function in C++11

There are some niceĀ C++11 APIs available to measure the execution times of a function(s). The library of interest here is <chrono>. It provides some basic methods to obtain timing information from the CPU. I generally use the following pattern to determine timing information for my code: See the C++ documentationĀ for other methods included in the…

Read more Timing the execution of a function in C++11