15,957,877 members
See more:
```hi iam started to study c++ module this sem can help me out, I don't able to understand the meaning of this line `map<int, BST<Data>**>::iterator itr = tree.begin()

for (map<int, BST<Data>**>::iterator itr = tree.begin(); itr != tree.end(); ++itr)
{
if (itr->first == y)
{
for (int i = 0; i < 12; i++)
for (int j = 0; j < 31; j++)
sum(itr->second[i][j].root, c[i], sumS[i], sumSR[i], sumT[i]);
break;
}
}```

What I have tried:

Class Bst is the normal binary search tree programme
Posted
Updated 2-Feb-21 4:14am

## Solution 3

An article by yours truly.

Pointer to Pointer and Reference to Pointer[^]

## Solution 2

I'd suggest to read this: Double Pointer (Pointer to Pointer) in C - GeeksforGeeks[^]

Quote:
We already know that a pointer points to a location in memory and thus used to store the address of variables. So, when we define a pointer to pointer. The first pointer is used to store the address of the variable. And the second pointer is used to store the address of the first pointer. That is why they are also known as double pointers.

Got it?

v2

## Solution 4

It's a pointer to a pointer to data. [Usually] data structures don't store the data themselves but store only a pointer which is then allocated for every element (this allows for the data structures to be generic, i.e. not dependent on the type of the contained data, via templates / generic / casting to and from void* depending on the lanfguage).

In this case the iterator returns a pointer to the data element, which is itself a pointer to the data themselves.

This is not the only way to use double (or multiple) pointers but it is definitely one of the most common.