title: Hash table implementation for storing strings
body: <p>This is my code for a hash table which stores string values.To use Linear probing in my "insert" function, I need to check whether the pointer is NULL at that specific hash value. I Haven't completed my insert function yet, but I am stuck because when I check for <strong>if(the_hash_table[n]==NULL)</strong>   inside the insert function, it does not enter the branch. Before hashing the value if I print "the_hash_table[1]" it prints "faz", but after that step when I print it, it prints some weird characters. Where have I gone wrong?</p>
  
  <pre><code> #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
      #include &lt;string.h&gt;
  
      /*
      creates a hash table of size 10
      */
  
      char** create_hash_table(){
  
  
  
          char* the_hash_table[10];   // defines a hash table to store strings
  
          *the_hash_table=malloc(sizeof(char*)*10); // allocates memory in the heap for the hash table
          int i;
          for(i=0;i&lt;10;i++){ // this loop initializes the string pointers to NULL at the starting point of the hash table
              the_hash_table[i]=NULL;
          }
          return &amp;the_hash_table; // returns the address of the hash table to the main memory
  
      }
  
      /*
      this is a method to insert a string into the relevant position of the hash table
      */
  
      void insert(char* the_string,char** the_hash_table){
  
          printf("%s",the_hash_table[1]);
          int n=hash(the_string);
          printf("%s",the_hash_table[1]);
          if(the_hash_table[n] == NULL)
              the_hash_table[n]=the_string;
  
      }
  </code></pre>