I decided to test-compile a class that I'm making and I'm getting strange errors which i've never seen before in some very simple code. I'm posting the three files here with errors numbered and their occurences commented. My compiler is Dev-C++ 4.9.9.1. If anyone has any ideas please let me know.
ERRORS:
1 expected unqualified-id before "using"
2 expected `,' or `;' before "using"
3 `cout' undeclared (first use this function)
4 `endl' undeclared (first use this function)
5 ISO C++ forbids declaration of `vector' with no type
6 expected `;' before '<' token
Code:MAIN: #include <cstdlib> #include <iostream> #include "HashTable.h" using namespace std; // <- Error 1 and 2 int main() { HashTable H; cout << "End of Program." << endl; // <- Error 3 and 4 return EXIT_SUCCESS; } HASHTABLE.H: #ifndef _HashTable_H_ #define _HashTable_H_ class HashTable { public: HashTable(int size = 101); private: vector<char*> array; // <- Error 5 and 6 } #endif HASHTABLE.CPP: #include <iostream> #include <vector> #include "HashTable.h" using namespace std; HashTable::HashTable(int size) { array.resize(size); }