C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

In C++, constructors are one of the important parts of class types. There are different constructor types in C++ classes and the Copy Constructor is one of these. Copy Constructors are not only used in classes but also used with struct and union data types. In this post, we will try to explain the types of Copy Constructors in modern C++. What is the Constructor in C++ classes? The…
Read more
C++C++11C++14C++17C++20Introduction to C++Learn C++Syntax

Learn Default Constructors Of Classes In Modern C++

Classes in C++ are the main building blocks of Object Oriented Programming Tools. They have a special function known as a constructor which is automatically called when an object of a class is created. There is a default constructor type in classes that is called when a class is defined with no arguments, or it is defined with an empty parameter list, or with default arguments provided for every…
Read more
C++C++11C++14C++17C++20Introduction to C++Learn C++Syntax

How To Use Basic Methods Of Wide Strings In C++?

In C++, one of the most used variable types are text strings, also known as alphanumeric variables, and they are really important when storing and retrieving valuable data. It is important to store your data safely in its language and localization. In modern C++, strings are std::basic_string types such as std::string, and std::wstring. In this post, we explain some methods of std::wstring in…
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