We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Tag: From

How to erase elements from a list in c++ using iterators

In this article we will see how to erase elements from a std::list using iterators. std::list provides 2 member function to delete elements using iterators i.e. Advertisements iterator erase (const_iterator position); It deletes the element representing by passed iterator “position” and returns the iterator of element next to last deleted element. iterator erase (const_iterator first, const_iterator last); …

How to erase elements from a list in c++ using iteratorsRead More

How to call Base class’s overridden method from Derived class in java

In this article we will discuss how to call parent class’s overridden method from a derived class method in Java. Suppose we have a Base class which has a function display() i.e. Advertisements class Base { public void display() { System.out.println(“Base :: display”); } } Now we will create a Derived class that will extend this …

How to call Base class’s overridden method from Derived class in javaRead More

How to Erase / Remove an element from an unordered_map

In this article we will discuss the different ways to remove an element from an unordered_map. Unordered_map provides different overloaded version of erase() member function to delete key value pairs from map. Advertisements Erasing an element from an unordered_map by key Unordered_map provides following overloaded version of erase() that accepts a key by value and …

How to Erase / Remove an element from an unordered_mapRead More

How to Add / Subtract Days, Months or Years from a Date in C++

In this article we will discuss how to add or subtract days, months & Years from a date object. Add / Subtract Days from a Date For example, if current date is 21 March 2016. Then subtracting 100 days from this date will make the date 12 Dec 2015 Advertisements For this we will use …

How to Add / Subtract Days, Months or Years from a Date in C++Read More

Java : How to Remove elements from HashMap while Iterating

In this article we will discuss different ways to remove elements from HashMap while Iterating. Let’s create a HashMap of String as Key and Integer as value and add some elements into it i.e. Advertisements // Create a HashMap of string and int HashMap<String, Integer> wordFreqMap = new HashMap<>(); // Add elements in Map wordFreqMap.put(“this”, …

Java : How to Remove elements from HashMap while IteratingRead More

Different ways to Erase / Delete an element from a Set in C++

In this article we will discuss different ways to remove an element from Set. std::set provides 3 overloaded version of erase() member function. We will discuss them one by one. Advertisements Suppose we have a set of strings i.e. //Set Of Strings std::set<std::string> setOfStrs = {“Hi”, “Hello”, “is”, “the”, “at”, “Hi”, “is”, “from”, “that”}; Let’s …

Different ways to Erase / Delete an element from a Set in C++Read More

Erase elements from a Set while Iterating in C++ & Generic erase_if()

In this article we will discuss how to erase elements from a set while iterating over it. Erasing elements from std::set while Iterating std::set provides a member function erase() that accepts an iterator as an argument and deletes it from the set i.e. iterator erase (const_iterator position); But it makes the passed iterator invalid. From …

Erase elements from a Set while Iterating in C++ & Generic erase_if()Read More

Cart

Your Cart is Empty

Back To Shop