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
Server Side Programming Articles - Page 2314 of 2650
161 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
245 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
270 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
764 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
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
604 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
190 Views
In this C++ program, we implement Sorting containers in STL.Functions and descriptions:Functions used here: l.push_back() = It is used to push elements into a list from the front. l.sort() = Sorts the elements of the list. Where l is a list object.Example Code#include #include #include #include using namespace std; int main() { list l; list::iterator it; int c, i; while (1) { cout
767 Views
The Set Union is an operation used to find all elements that are present in either of the sets or in both. In this article, we will learn how to use the set_union algorithm from the Standard Template Library (STL) in C++ to find the union of two sets. What is Set Union? The set union is an arithmetic operation performed between two sets to find all elements that are present in either of the sets or in both. In C++, we have set_union which is a built-in algorithm provided by C++ STL that computes the union of two ... Read More