
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

232 Views
The multiset insert() function in C++ STL which insert elements in the multiset container from a position to another position from one multiset to a different multiset.List of functions used:ms.size() = Returns the size of multiset. ms.insert() = It is used to insert elements to the multiset.Example Code#include #include #include #include using namespace std; int main() { multiset ms; multiset::iterator it, it1; int c, i; while (1) { cout

153 Views
The lldiv() function is used to perform division operation on long long integers and return both quotient and remainder. In this article, we will learn how to use the lldiv() function from the Standard Template Library (STL) in C++. What is lldiv()? The lldiv() is a in-built function in C++ that is used to divide one long long integer by another and return the result as a structure that contains both the quotient and remainder. This function is useful when both values are needed after a division operation. The return type of this function is a structure called lldiv_t, ... Read More

231 Views
The iswalpha() function is an extension of the isalpha() function, which supports character identification of all languages. In this article, we will learn how to use the iswalpha() function from the Standard Template Library (STL) in C++. What is iswalpha()? The iswalpha() function is used to check whether a given wide character is an alphabetic character. Wide character means the larger set of characters, which includes the characters from all languages. The iswalpha() function returns true if the input character is a letter, such as from English, Hindi, Chinese, etc. The regular isalpha() function will only work with alphabets ... Read More

241 Views
The iswalnum() function is an extension of isalnum() function to support character identification of all languages. In this article, we will learn how to use the iswalnum() function from the Standard Template Library (STL) in C++. What is iswalnum()? The iswalnum() function is used to check whether a given wide character is alphanumeric. An alphanumeric character is either an alphabet letter (a-z, A-Z) or a digit (0-9). Wide character means, the larger set of characters, which include the characters from all the languages. The iswalnum() function returns true if the input character is either a letter from any language ... Read More

1K+ Views
The STL set is a container that stores unique elements in a sorted order. Insertions and deletions are common operations performed in containers like std::set and std::vector. In this article, we will learn how to insert and delete elements in a C++ STL set. Insertion in STL Set To insert a new element into a std::set you can use the insert method or the emplace method. Let's understand how to use these methods with examples. Using insert Method Using emplace Method 1. Using insert Method The insert ... Read More

747 Views
To remove an item from a C++ STL vectors by value, you can use the std::remove inside the argument of erase method of the vector. There are some other methods as well. In this article, we will learn all the approaches to remove an item from a C++ STL vector. The easiest way to remove an item from a vector is to use the std::remove algorithm inside the erase method of the vector. For example: vector v = {1, 2, 2, 3, 2, 5}; // Remove all occurrences of 2 v.erase(remove(v.begin(), v.end(), 2), v.end()); Remove an ... Read More

1K+ Views
In C++ STL, both emplace and insert functions are used to add elements to containers such as vectors, lists, and maps. But, emplace is more efficient than insert as it avoids unnecessary copying of object and does the insertion more efficiently than insert operation. In this article, we will discuss the all the differences between emplace and insert with examples. Insert in C++ STL The insert function in C++ STL is used to add new elements to a container (ie, set, map, vector, list, etc.). Following is the syntax of insert function: // insert into a pair multiset set1; ... Read More

4K+ Views
Generally, the default behavior of map and multimap map is to store elements is in ascending order. But we can store element in descending order by using the greater function. Map in Descending Order We use a map to store elements in descending order with the help of the greater function. We perform various operations like inserting elements, finding an element, counting occurrences of keys, and removing elements from the map. Functions are used here - m::find() – Returns an iterator to the element with key value ‘b’ in the map if found, else returns the iterator to ... Read More

581 Views
Vector is a special type of array in C++, which have ability to resize itself automatically during insertion and deletion of elements.. In this article, we will learn how to use the vector container from the Standard Template Library (STL) in C++. What is a Vector? A vector is a container that stores data elements in a dynamic contiguous memory. It is similar to arrays but can change its size dynamically during execution. Meaning, we doesn't need explicitly mention the size of a vector, it will be calculated automatically by counting number of elements in it. Similar to arrays, ... Read More

1K+ Views
Stack is a linear data structure that follows the Last In First Out (LIFO) principle. In this article, we will learn how to use the stack container from the Standard Template Library (STL) in C++. What is Stack? A stack is a container that stores data in a way that the last inserted data will be the first to be removed. This is same as a stack of plates, where the last plate placed on the top is the first one to be removed. The STL library of C++ provides a pre-defined stack data structure which comes with all ... Read More