title: Undeclared identifier and type 'int' unexpected error when calling a class from main
body: <p>Hey guys so I am working on a Hash program in C++ for my class.  I am using a template T class for my header file and when I try to call the class constructor from main it gives me a undeclared identifier and type 'int' unexpected error.  Here is my HashTable.h file:</p>
  
  <pre><code>#pragma once
  #include "Record.h"
  #define MAXHASH 1000
  #ifndef HASHTABLE_H
  #define HASHTABLE_H
  using namespace std;
  
  template &lt;class T&gt; class HashTable
  {
  public:
      HashTable();
      ~HashTable();
      bool insert(int, T, int&amp;);
      bool remove(int);
      bool find(int, T&amp;);
      float alpha();
  private:
      int key;
      T value;
   };
  
  #endif
  </code></pre>
  
  <p>and here is my main: </p>
  
  <pre><code>#include "HashTable.h"
  #include "stdafx.h"
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      HashTable&lt;int&gt; *test = new HashTable&lt;int&gt;();
      return 0;
  }
  </code></pre>
  
  <p>Here's the constructor in the .cpp file as well:</p>
  
  <pre><code>#pragma once
  #include "stdafx.h"
  #include "HashTable.h"
  #include "Record.h"
  #define HASHTABLE_CPP
  #ifndef HASTABLE_CPP
  
  
  template &lt;class T&gt;
  HashTable&lt;T&gt;::HashTable()
  {
      Record hashArray = new Record[MAXHASH];
      for (int i = 0; i &lt; MAXHASH; i++)
      {
          hashArray[i]-&gt;key = 0;
          hashArray[i]-&gt;value = NULL;
      }
  }
  </code></pre>
  
  <p>The specific errors I am getting are:
  <b></p>
  
  <blockquote>
  <pre><code>Error C2062   type 'int' unexpected identifier 
  
  Error C2065   'HashTable': undeclared identifier      
  </code></pre>
    
    <p></b></p>
  </blockquote>
  
  <p>Both the errors point to the call line in main.  </p>
  
  <p>It is difficult because I can't test my program until I can get this test hash to work.  Any input on how to fix this issue would be awesome!</p>