Posts from C++

Iterate through map in C++

By Mahak Chawla

In this tutorial, we will discuss how to iterate over a map in C++. There are multiple ways by which we can iterate through a map. We will understand various ways one by one. 1. Us.... Read More

How to convert a string to a vector of chars in C++

By Paras Bhargava

In this tutorial, we will learn how to convert a string to a vector of chars in C++. We will be learning about some functions of the string standard library and some functions of t.... Read More

vector::resize() vs vector::reserve() in C++ – Differences

By Mahak Chawla

This tutorial will show how vector::resize() differs from vector::reserve() in C++. There are basically two main concepts regarding the space of vectors: size and capacity. The cap.... Read More

Count the number of unique elements in a vector in C++

By Mahak Chawla

Given a vector in C++, the task is to find the number of distinct elements present in the vector. Example: Input:  v={ 16, 10, 9, 25, 2, 16, 10, 9 } Output: 5 Explanation: There a.... Read More

Find the largest three elements in an array using C++

By Satyam Chauhan

In the following tutorial, we are going to learn how to find the three largest elements in an array in C++. So, let’s start with the code: #include<iostream> using name.... Read More

Understanding Map in C++

By Abhishiek Bhadauria

Welcome! In this post, we will see what are maps and the functions of the map along with some examples in C++ programming. A Map is a container that stores the element in a map fas.... Read More

C++ Program To Get All Keys From Map

By Abhishiek Bhadauria

In this tutorial, we will learn how to retrieve all keys from a map in C++. A Map is a container that stores an element in a map fashion. Each element has a key and a corresponding.... Read More

std::bitset::to_ullong and std::bitset::to_ulong in C++

By Amrita Sony

Learn about two useful functions of c++ that are  std::bitset::to_ullong and std::bitset::to_ulong. Both of these functions are found in std::bitset the header. std::bitset repres.... Read More

Related Posts