What is ** doing in this simple hash implemtation?
<p>I know <code>*</code> defines a pointer... does <code>**</code> define a pointer to a pointer?</p>

<p>If so, why?</p>

<p>Is a pointer to a pointer some times known as a reference? Just need clarification for the following very simple hash.</p>

<p>Generally pointers are used to pass the location of larger structures when passng the entire contents would be too costly.</p>

<p>I've seen pointers to pointers used in the quantlib project to create "handles" as each "observer" holds a pointer to a "term structure" pointer that might change at run-time, hence the pointer held the location of another pointer.</p>

<p>However I see no correlation here?</p>

<pre><code>class hash_entry 
{
private:
    int key;
    int value;
public:
    hash_entry(int key, int value) 
    {
        this-&gt;key = key;
        this-&gt;value = value;
    }
    int getKey() 
    {
        return key;
    }
    int getValue() 
    {
        return value;
    }
};

class hash_map 
{
private:
    hash_entry **table;
    static const int TABLE_SIZE = 128;
public:
    hash_map() 
    {
        table = new hash_entry*[TABLE_SIZE];
        for (int i = 0; i &lt; TABLE_SIZE; i++)
            table[i] = NULL;
    }
    int get(int key) 
    {
        int hash = (key % TABLE_SIZE);
        while (table[hash] != NULL &amp;&amp; table[hash]-&gt;getKey() != key)
            hash = (hash + 1) % TABLE_SIZE;
        if (table[hash] == NULL)
            return -1;
        else
            return table[hash]-&gt;getValue();
    }
    void put(int key, int value) 
    {
        int hash = (key % TABLE_SIZE);
        while (table[hash] != NULL &amp;&amp; table[hash]-&gt;getKey() != key)
            hash = (hash + 1) % TABLE_SIZE;
        if (table[hash] != NULL)
            delete table[hash];
        table[hash] = new hash_entry(key, value);
    }
    ~hash_map() 
    {
        for (int i = 0; i &lt; TABLE_SIZE; i++)
            if (table[i] != NULL)
                delete table[i];
        delete[] table;
    }
};
</code></pre>
