C++11C++14C++17Learn C++Numerics

Introduction to Random Number Generation in Modern C++

Every implementation of the C++ Standard Library like one included to Embarcadero RAD Studio C++ compilers provides two ways for (pseudo-)random numbers generation: old-fashioned facilities from <cstdlib> and modern facilities provided by <random>. Facilities from <cstdlib> There are two very simple functions provided by the C random library: std::srand() and std::rand().
Read more
C++11C++14C++17IteratorsLearn C++

Range-for-statement in Modern C++

Since C++11 there are elegant way to access each element of a containers (or, more generally, sequences) – so called range-for-statement. The syntaxes are follow: template<class Container> void foo(Container& container) { for (auto element : container); // (1) for (const auto element : container); // (2) for (auto& element : container); // (3) for…
Read more
C++C++11C++14C++17ComponentsIntroduction to C++Learn C++

Learn Basic Components in C++ Builder (QuickLook Part 1)

In this article we will add some quick methods to show how to use basic components in C++ Builder. Most of component properties and methods are same in VCL and FMX projects. If you are a beginner we highly recommend you to watch this Introduction To C++ Windows Development With C++Builder video to understand C++ Builder / RAD Studio IDE interface and some basic mechanisms. This video will help…
Read more
C++C++11C++14C++17IteratorsLearn C++

Reverse Iterators in C++

By using bidirectional iterator or random access iterator (see Iterator Categories in C++) it’s possible to traverse the sequence in backward direction by using operator -- or by using the special adapter template class std::reverse_iterator. But why to bother with reverse iterators if the operator -- is available for iterators with bidirectional traversing capabilities? The answer is…
Read more