I keep getting these errors. I'm so lost please help... fairly new to c++ programming.
hashheader.h(8) : error C2144: syntax error : 'int' should be preceded by ';'
hashheader.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
hashheader.h(14) : error C2061: syntax error : identifier 'string'
hashheader.h(20) : error C2061: syntax error : identifier 'HashElement'
hashheader.h(26) : error C2146: syntax error : missing ';' before identifier 'get'
hashheader.h(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
hashheader.h(26) : error C2061: syntax error : identifier 'string'
hashheader.h(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
hashheader.h(26) : warning C4183: 'get': missing return type; assumed to be a member function returning 'int'
hashheader.h(36) : error C2146: syntax error : missing ';' before identifier 'words'
hashheader.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
hashheader.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
#include <iostream>
#include <cstring>
#include <fstream>
#ifndef HASHTABLE
#define HASHTABLE
tyepdef int HashElement;
class HashTable
{
public:
int hash(string word);
/*
a function that determines an array index for key.
the function sums the values of the ascii codes for each letter
in the key and returns the sum to the caller.
*/
void put(HashElement entry);
/*
places the entry into a hash table
it uses linear probing to resolve collisions.
*/
HashElement get(string key);
/*returns the element in the hash table that has the key 'string key'.
the record is retrieved by hashing.
*/
void display (int lowerbound, int upperbound);
//prints entries between lower bound and upper bound
private:
string words[16000];
//array of 16000 strings
};
#endif