What is NULL, does it need to be declared?
<p>In this snippet I found <a href="http://www.algolist.net/Data_structures/Hash_table/Simple_example" rel="nofollow">here</a> for a simple C++ hash everywhere there is a NULL I get a </p>

<blockquote>
  <p>NULL was not declared in this scope.</p>
</blockquote>

<p>I'm using MinGW compiler g++.  My guess is that NULL is not a reserved keyword?  How could I determine the version of gcc and look at a reference list for C++ keywords?  </p>

<p>This list <a href="http://en.cppreference.com/w/cpp/keywords" rel="nofollow">here</a> states that NULL is not a keyword.</p>

<pre><code>int main()
  {
  }

const int TABLE_SIZE = 128;
class HashEntry 
  {
  private:
    int key;
    int value;
  public:
    HashEntry(int key, int value) 
      {
      this-&gt;key = key;
      this-&gt;value = value;
      }
    int getKey() 
      {
      return key;
      }
    int getValue() 
      {
      return value;
      }
  }; 
class HashMap 
  {
  private:
    HashEntry **table;
  public:
    HashMap() 
      {
      table = new HashEntry*[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 HashEntry(key, value);
      }     
    ~HashMap() 
      {
      for (int i = 0; i &lt; TABLE_SIZE; i++)
        if (table[i] != NULL) delete table[i];
      delete[] table;
      }
};
</code></pre>
