title: Insert function of Hashtable in C
body: <p>So, I have the functions. How can I insert numbers in the <code>Hashtable</code>? A <code>for</code> that goes until the size of the table? I don't know what goes inside the <code>for</code>, if it is exists. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  //Structure
  typedef struct Element {
      int key;
      int value;
  } Element;
  
  typedef struct HashTable {
      Element *table[11];
  } HashTable;
  
  
  //Create an empty Hash
  HashTable* createHashTable() {
      HashTable *Raking = malloc(sizeof(HashTable));
  
      int i;
      for (i = 0; i &lt; 11; i++) {
          Raking-&gt;table[i] = NULL;
      }
      return Raking;
  }
  
  //Insert element
  void insertElement(HashTable *Raking, int key, int value) {
  
      int h = hashFunction(key);
  
      while(Raking-&gt;table[h] != NULL) {
  
          if(Raking-&gt;table[h]-&gt;key == key) {
              Raking-&gt;table[h]-&gt;value = value;
              break;
          }
  
          h = (h + 1) % 11;
      }
  
      if(Raking-&gt;table[h] == NULL) {
          Element *newElement = (Element*) malloc(sizeof(Element));
          newElement-&gt;key = key;
          newElement-&gt;value = value;
          Raking-&gt;table[h] = newElement;
      }
  }
  
  int main() {
  
      HashTable * Ranking = createHashTable();
  
  
      /** ??? **/
  
  
  }
  </code></pre>
  
  <p>Could someone explain to me how to write my main function with these structures? In this case I'm fixing the number of elements in this table, right? (table [11]) What could I do for the user to determine the size of the hash table? is it possible? Or should I set the size?</p>