title: Searching in a hash table HELP!
body: <p>I am trying to write a hash table for class and I can't seem to get this while loop working.  Do you guys see anything wrong with it? The while loop is ending prematurely, I think there is something wrong with my while loop condition?</p>
  
  <pre><code>void search(store t[], string s, int num, int table_size)
  {
    int temp = num;
    bool exit = false;
    while(t[temp].data != s &amp;&amp; !exit){
      temp++;
      if (temp == table_size){
        cout&lt;&lt;"reached 0 inside while loop"&lt;&lt;endl;
          temp = 0;
      }
      if (temp == num){
        cout&lt;&lt;"test search loop"&lt;&lt;endl;          //I can't seem to get into here.
        exit = true;
      }
    }
    if(t[num].data == s)
      cout&lt;&lt;"("&lt;&lt;s&lt;&lt;")"&lt;&lt;" appears "&lt;&lt;t[num].count&lt;&lt;" times."&lt;&lt;endl;
    else
      cout&lt;&lt;"your string is not in my table"&lt;&lt;endl;
  }
  </code></pre>