Practical solutions

C++ Howtos How-To Guides

Solve the problem. Keep building. Collection of C++ how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Add Message to Assert in C++This tutorial demonstrates C++ assert with message. How to Dereference Pointers in C++This tutorial provides a brief discussion on how to dereference a pointer in C++. How to Compile and Run C++ 11 Codes in Dev C++This article is a brief guide for compiling and running C++ 11 codes using Dev C++ compiler. How to Convert to SHA256 in C++This article focuses on the concept of hashing and the SHA256 algorithm. It includes a detailed explanation of the SHA256 algorithm along with code snippets in C++ to make understanding easier. At the end of the article, the whole C++ program is provided. How to Get the MD5 Hash of a File in C++This tutorial demonstrates the working of MD5 algorithm that the MD5 message-digest is a cryptographic protocol which is used for authentication processes in the digital world. It is based on the hashing function for verification of files or text. The prominent 4 steps of MD5 algorithm are padding bits, append length, initialize MB buffer, and processing each block. How to Implement the if Statement With Multiple Conditions in C++This article discusses the usage of if statements with multiple conditions in C++ using relevant examples. How to Check if an Array Contains an Element in C++In this article, we will discuss the various approaches to check if an array contains an element in C++. We will see how a simple loop can be used to do this. Also, we will be using some algorithms and functions from the C++ standard library that can help us do the same. How to Generate Random Values by Dice Roll in C++This article explains how random numbers can be generated using the time factor method and arbitrary number method that imitate dice roll in C++. Learn how it works and what disadvantages it contains. A C++ program is provided to demonstrate a pseudo number generator. How to Fix the Multiple Definitions of a Function Error in C++This article is about the solution to the error of multiple function definition in C++. How to Create a Lookup Table in C++This article focuses on explaining how look up tables are created and its uses in different scenarios. Three code examples are provided to make understanding easier, with code snippets to understand the code in detailed manner. How to Compare String and Character in C++An article about the use of string and char in C++ and their comparison. How to Iterate Through a List in C++This is an easy tutorial about the List data structure and how we can iterate through the List data structure in C++. How to Initialize 2D Vectors in C++This article is a programming guide about the use and how to initialize 2-dimensional vectors in C++. How to Sort Linked List in C++This programming tutorial demonstrates the implementation of the sort operation on a Linked List data structure in C++. How to Overload the == Operator in C++This is a programming tutorial for the implementation of the == operator overloading in C++. How to Access Private Variable in C++This article discusses about C++ private variables. We have also discussed how to access private variable in C++. How to Set vs Hashset in C++This article explains set and hashset in C++. The differences between the structures present in the C++ STL are highlighted clearly. Finally, their working of storing the unique elements has also been discussed clearly. How to Catch All Exceptions in C++To handle all exceptions in C++, we can use the try-catch block. A try-catch statement is a part of the C++ programming language that executes an exception handler if an exception occurs. How to Find the Type of an Object in C++This article discusses different approaches to find the type of objects in C++. How to Define and Use Negative Infinity in C++This article discusses the problem of representing negative infinity in C++ and lists some possible solutions. How to Find the Square Root Without Using the SQRT Function in C++We can find the square root in C++ without using the square root function and in this article, we will explain how to do this. How to Convert Radians to Degrees in C++There are multiple methods to convert radians to degrees in C++, we will discuss them all in this article. How to Allocate and Deallocate the Memory in C++Memory allocation and deallocation is responsible for managing dynamic memory in the program, which includes allocating memory to be used during program execution and releasing allocated memory when it is no longer needed. How to Jump to Case Label in the switch StatementThis article will discuss the switch statement in C++ and some common mistakes while using it.