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

What Is Set (std::set) In Modern C++?

Modern C++ has a lot of options to add and modify data members with its amazing data holders, arrays, structs, pointers, and containers. Containers are powerful data storage arrays in C++ and they are very useful to iterate and search. A container is a holder object that stores data elements (a collection of data objects). std::array, std::vector, and std::map are these kinds of containers.
Read more
C++C++11C++14C++17C++20Introduction to C++IteratorsLearn C++Syntax

What Are The Differences Between std::rand() And std::mt19937 In Modern C++?

Random numbers are widely used in today’s modern applications. In C we use rand(), srand() and in C++ it is std::rand(), std::srand(). Since C++11, we can use the Mersenne Twister random generators;  mt19937 (std::mt19937) for 32-bit applications and mt19937_64 (std::mt19937_64) for 64-bit applications. Modern C++ allows us to use both old and new random generators. In this post, we explain…
Read more
C++C++11C++14C++17Introduction to C++Learn C++

Everything You Need To Know About The Copy Assignment Operator In C++ Classes

Classes and Objects are part of object-oriented methods and typically provide features such as properties and methods. One of the great features of an object orientated language like C++ is a copy assignment operator that is used with operator= to create a new object from an existing one. In this post, we explain what a copy assignment operator is and its types in usage with some C++…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

What Are The CMath Mathematical Functions in Modern C++?

In C++11 and C++14, we were able to use this math.h library in C++ applications. After the C++17 standard, this library is modernized in the cmath library, and functions are declared in <cmath> header for compatibility reasons in modern C++, and the <math.h> is an optional header to support legacy code. In this post, we list most of these mathematical functions declared in the <cmath>…
Read more