Expand|Select|Wrap|Line Numbers
- In file included from HTTest.cpp:2:
- HashTable.h:52: error: ISO C++ forbids declaration of `vector' with no type
Expand|Select|Wrap|Line Numbers
- vector<list<int> > theLists;
I think the problem lies in the fact that it can't find the vector or list header files (or maybe just the list header file). Here's my trimmed up code:
Expand|Select|Wrap|Line Numbers
- #ifndef HASH_TABLE
- #define HASH_TABLE
- #include <vector>
- #include <list>
- #include <algorithm>
- class HashTable {
- public:
- explicit HashTable(int size = 101);
- bool contains(int x) const;
- void makeEmpty();
- bool insert(int x);
- bool remove(int x);
- int avgLoad();
- private:
- vector<list<int> > theLists; // This is line 52 in my 'real code'.
- int currentSize;
- int myhash(int x) const;
- };
- #endif
Thanks a lot guys!