## How to Convert a char array to String in C++?

In this article, we will discuss different ways to convert a char array to a string in C++. Table Of Contents Problem Description Convert char array to string using simple addition Convert char array to string using stringstream Convert char array to string using push_back() function Summary Problem Description We have given an array that […]

## How to Sort an Array of pairs in C++?

In this article, we will discuss different ways to sort an array of std::pair in C++. Table Of Contents Problem Statement Sort Array of Pairs using STL sort() function Using Normal Function as argument in sort() Using Lambda Function as argument in sort() Sort Array of Pairs using Bubble sort Summary Problem Statement In this

## How to Sort an Array of structs in C++?

In this article, we will discuss different ways to sort an array of structs in C++. Table Of Contets Problem Statement Sorting array of structs using STL sort() in C++ Using sort() with a function as comparator Using sort() with a Lambda function as comparator Sorting an Array od Structs Using Bubble sort algorithm Summary

## Sort an Array in Ascending Order in C++ (6 Ways)

In this article, we will discuss different ways to sort an array in C++. Table Of Contents Problem Description Sort an Array in C++ using STL function sort() Sort an Array in C++ using Bubble Sort Approach Sort an Array in C++ using Insertion Sort Approach Sort an Array in C++ using Selection Sort Approach

## Find minimum value and its index in an Array in C++

In this article, we will discuss different ways to find the minimum value in an array and also its index position. Table Of Contents Problem Description Find Min value in Array using Linear traversal -(Iterative Method) Find Min value in Array using STL function Find Min value in Array using min() and find() Summary Problem

## How to check if an Array is Sorted in C++

In this article, we will discuss different ways to check if an array is sorted or not in C++. Table Of Contents Problem Description Check if array is sorted using std::adjacent_find() Check if array is sorted using std::is_sorted() Check if array is sorted using Recursive Approach Check if array is sorted using Iterative Approach Summary

## How to Compare Arrays for equality in C++?

In this article, we will discuss how to compare two arrays in C++. Table Of Contents Problem Description Compare Arrays using Linear traversal (Iterative Method) Compare Arrays using STL function equal() Summary Problem Description Here, we are given two arrays, and we have to find if they are equal or not. Input Output There are

## Find maximum value and its index in an Array in C++

In this article, we will discuss different ways to find the maximum value in an array and also its index position. Table Of Contents Find Maximum value in Array using Linear traversal : Iterative Method Find Maximum value in Array using STL function max_element() and find() Find Maximum value in Array using max() & find()

## Find index of an element in an Array in C++

In this article, we will discuss different ways to find the index of an element in an array in C++. Table of Contents Find index of element in Array using Linear traversal (Iterative Method) Find index of element in Array using STL function std::find() Summary Here we are given an array and we have to

## Sort an Array in Descending Order in C++

In this article, we will discuss six different ways to sort an array in descending order in C++. Table Of Contents Sort Array in Descending Order in C++ using STL’s std::sort() Sort Array in Descending Order using Bubble Sort Sort Array in Descending Order using Insertion Sort Sorting Array in Descending Order using Selection Sort

Scroll to Top