I'm learning to build a hashtable with c++. And find this post: https://www.geeksforgeeks.org/c-program-hashing-chaining/. 
It implemented a simple and basic version of hashtable (not production level) with chaining to fix hash collision issue. 
I followed the post and run it locally and it works as expected. The implementation is as following:
#include <iostream>
#include <list>
using namespace std;
class Hash {
    int BUCKET;
    list<int> *table; // confusing point1 
    public:
        Hash(int V);
        void insertItem(int key);
        void deleteItem(int key);
        int hashFunction(int x) {
            return (x % BUCKET);
        }
        void displayHash();
};
Hash::Hash(int b) {
    this->BUCKET = b;
    table = new list<int>[BUCKET]; // confusing point2
}
void Hash::insertItem(int key) {
    int index = hashFunction(key);
    table[index].push_back(key);
}
void Hash::deleteItem(int key) {
    int index = hashFunction(key);
    list <int> :: iterator i;
    for (i = table[index].begin(); i != table[index].end(); i++) {
        if (*i ==  key) {
            break;
        }
    }
    if (i != table[index].end()) {
        table[index].erase(i);
    }
}
void Hash:: displayHash() {
    for (int i = 0; i < BUCKET; i++) {
        cout << i;
        for (auto x : table[i]) {
            cout << "-->" << x;
        }
        cout << endl;
    }
}
// Driver program  
int main() 
{ 
  // array that contains keys to be mapped 
  int a[] = {15, 11, 27, 8, 12}; 
  int n = sizeof(a)/sizeof(a[0]); 
  // insert the keys into the hash table 
  Hash h(7);   // 7 is count of buckets in 
               // hash table 
  for (int i = 0; i < n; i++)  
    h.insertItem(a[i]);   
  // delete 12 from hash table 
  h.deleteItem(12); 
  // display the Hash table 
  h.displayHash(); 
  return 0; 
}  
I have two confusing points about this implementation: 
- list<int> *table: table should be buckets array. Right?- list<int> *should be list type pointer, right? How it works here?
- table = new list<int>[BUCKET]: I checked many list related
 documents. but didn't find how the- []works?
 
    