Associative arrays are also called map or dictionaries. In C++. These are special kind of arrays, where indexing can be numeric or any other data type
i.e can be numeric 0, 1, 2, 3.. OR character a, b, c, d… OR string geek, computers…
These indexes are referred as keys and data stored at that position is called
So in associative array we have (key, value) pair.
We use STL maps to implement the concept of associative arrays in C++.
Now we have to print the marks of computer geeks whose names and marks are as follows
Name Marks Jessie 100 Suraj 91 Praveen 99 Bisa 78 Rithvik 84
The marks of all students are 84 100 99 78 91 the marks of Computer geek Jessie are 100 the marks of geeksforgeeks contributer Praveen are 99
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Sequence vs Associative containers in C++
- Find sub-arrays from given two arrays such that they have equal sum
- Arrays in C/C++
- Why is a[i] == i[a] in C/C++ arrays?
- Multidimensional arrays in PHP
- How to join two Arrays using STL in C++?
- Arrays and Strings in C++
- Multidimensional Arrays in C / C++
- How arrays are passed to functions in C/C++
- Variable Length Arrays in C and C++
- Initialization of a multidimensional arrays in C/C++
- Minimum sum of product of two arrays
- How do Dynamic arrays work?
- C# | Using foreach loop in arrays
- Find N'th item in a set formed by sum of two arrays
- How to quickly swap two arrays of same size in C++?
- Sum of special triplets having elements from 3 arrays
- How to find common elements between two Arrays using STL in C++?
- Python: Operations on Numpy Arrays
- Count pairs from two sorted arrays whose sum is equal to a given value x
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.