C++C++11C++14C++17C++20Learn C++Syntax

What Is make_unique And How To Use With unique_ptr In C++

Allocating memory and freeing it safely is hard if you are programming a very big application. In Modern C++ there are smart pointers that help avoid the mistake of incorrectly freeing the memory addressed by pointers. Smart pointers make it easier to define and manage pointers, they came with C++11. The most used types of C++ smart pointer areunique_ptr, auto_ptr, shared_ptr, and weak_ptr.
Read more
C++C++11C++14C++17C++20Learn C++Syntax

What Is The Volatile Keyword In C++?

C++ is very strong in every aspect of modern programming. Volatile types are used with the volatile keyword. It is a lesser known type qualifier that is important to read types or objects whose value can be modified at any time. The volatile keyword is useful in memory-mapped applications, generally these are from a hardware device, from a sensor, from an input device, or data from on an IoT. For…
Read more
C++C++11C++14C++17C++20Learn C++

How To Solve Data Race Problems In Modern C++?

Inmulti-thread programming, data races are a common problem in threads. Data races occur when multiple tasks or threads access a shared resource without sufficient protection, leading to undefined or unpredictable behavior on runtime. In C++, the concurrency support library is designed to solve these kinds of data race problems. In this post, we explain how to solve data race problems in…
Read more