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

Why Was The Gets Function Removed In C++14?

Modern C++ has a lot of useful functions coming from C. One of them was the gets() function that we use to get string inputs and that we were able to use in C++11 or earlier. In C++14, the gets function was removed, while fgets or other input functions remain there. If you have older C++ code that uses the gets() functions your C++14 version compiler will not compile it. Why was the gets function…
Read more
C++C++14C++17C++20Learn C++

Learn How To Use Binary Literals In Modern C++

C++14 brings us fewer but useful features to modern C++ than the standards preceding it. The creator of C++, Bjarne Stroustrup says that improvements in C++14 were deliberately lower in quantity compared to C++11. One of the small but useful features is the introduction of “Binary Literals”. C++14 comes with the Binary Literals feature, and in this post, we explain how we can use…
Read more
C++C++11C++14C++17C++20Learn C++

How To Use Propagating Exceptions In Modern C++?

Modern C++ has many features to aid multi-thread programming that allow applications to be faster and more responsive. The C++11 standard offers the possibility of moving an exception from one thread to another. This type of movement is called propagating exceptions, exception propagation; also known as rethrow exception in multi-threading. To do that, some modifications have been made to the…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

Learn Strong Compare and Exchange In Modern C++

Since the C++11 standard, the Concurrency Support Library includes built-in support for threads (std::thread) with atomic operations (std::atomic). C++11 provides both weak and strong compare-and-exchange operations in multi-threading applications. Since C++11, strong compare and exchange are used in modern C++ standards such as C++14, C++17, C++20, and in other new standards. In this post, we…
Read more