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
- Sequence vs Associative containers in C++
- Find sub-arrays from given two arrays such that they have equal sum
- Why is a[i] == i[a] in C/C++ arrays?
- Arrays in C/C++
- How to join two Arrays using STL in C++?
- Multidimensional Arrays in C / C++
- Multidimensional arrays in PHP
- Minimum sum of product of two arrays
- C# | Using foreach loop in arrays
- How do Dynamic arrays work?
- How arrays are passed to functions in C/C++
- Initialization of a multidimensional arrays in C/C++
- Variable Length Arrays in C and C++
- Find N'th item in a set formed by sum of two arrays
- How to quickly swap two arrays of same size in C++?
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.