
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 7197 Articles for C++

2K+ Views
Maps are a special type of container in C++ where each element is a pair of two values, the key value and the mapped value. The key value is used to index each item, and the mapped values are the values associated with the keys. The keys are always unique, regardless of whether the mapped values are. To print a map element in C++, we have to use iterators. One element in a group of items is indicated by an iterator object. Iterators primarily work with arrays and other types of containers, such as vectors, and they have a specific ... Read More

2K+ Views
Although C++ lacks dictionaries, it does have a structure akin to them called a map. Two values−key and mapped values−are contained in each entry of a map. Each item is indexed using the key value, whereas the mapped values are the values connected to the keys. The mapped values may or may not be unique, but the keys are always unique. In this tutorial, we'll look at iterators and how they work with maps. Iterators in C++ An iterator object points to one element in a range of elements. Iterators are generally used with arrays and containers like vectors and ... Read More

1K+ Views
Displaying star patterns in different formats like pyramids, squares, and diamonds is very common in fundamental programming and logic building. We have seen several stars and number pattern problems while learning looping statements in programming. In this article, we will display the number Eight (8) made with stars in C++. In this program, we take the line number n which is the size of the upper half of the eight. The lower half will be identical. The eight-pattern will look like below Eight-Pattern with stars * * * * * * ... Read More

14K+ Views
Dictionaries aren’t present in C++, but it has a similar structure called map. Each entry of a map has a couple of values in it, which are key and mapped values. The key value is used for indexing each entry, whereas the mapped values are the values that are associated with the keys. Keys are unique, but the mapped values may or may not be unique. In this article, we take a look at how to initialize a map object and create it from another map object. Creating an empty map To create a map object, we need to import ... Read More

2K+ Views
Displaying numbers in different formats comes under fundamental coding problems to learn different concepts of coding like conditional statements and looping statements. There are different programs where we have printed special characters like stars to make triangles or squares. In this article, we will print numbers in spiral form like a square in C++. We will take the number of lines n as input, then starting from the top-left corner we will move towards the right, then down, then left and then up, then again towards the right, and so on. Spiral Pattern with Numbers 1 2 ... Read More

12K+ Views
Designing patterns using special characters like stars (asterisks) is one of the most common types of programs to understand looping concepts. There are plenty of other star pattern programs which are very common in nature. The star pyramid is fairly simple but much more effective to understand looping statements and their conditions. In this article, we will see how to display a square pattern using stars in C++. Initially the complete square and then the hollow square. Displaying Complete Square Pattern * * * * * * * * * * * * * * * * * * * ... Read More

742 Views
A map is a data structure in C++ and can be found in the STL class std::map. It is similar to the dictionaries that we see in Python. Each entry in a map object has a pair of values, one of which is the key value and the other is the mapped value. An entry on the map is found and uniquely identified using the key value. The key value in a map must always be unique, but the mapped value is not required to be. In this article, we focus on creating an empty map object. Creating an ... Read More

1K+ Views
Understanding looping ideas is made simpler by printing a star design. Asterisks are used in a variety of star patterns to form complete or hollow triangles or diamond forms. In this post, we will show how to create a center-aligned descending triangle in C++. The following table will contain the logic we create to print stars. The following table can help us understand. Syntax * * * * * * * * * * * * * * * * * * * * * * * * * ... Read More

3K+ Views
C++ does not have dictionaries by the same name as it is in python, but it has the same data structure having similar capabilities. C++ has support for maps, which is available in the STL class std::map. A map object contains a pair of values in each entry, one is a key value and the other one is the mapped value. The key value is used to search and uniquely identify an entry in the map. Whereas the mapped value is not always unique, the key value has to be always unique in a map. Let’s take a look at ... Read More

638 Views
When learning programming, displaying a star pattern makes looping concepts easier to get. The star patterns are various designs that use asterisks to create hard or hollow triangles or diamond forms. This article will demonstrate a C++ implementation for an upward triangle that is center-aligned. The following table will contain the logic we create to print stars. The following table can help us understand. * * * * * * * * * * * * * * * ... Read More