title: I need help on my code, it gives me an error control may reach end of non-void function
body: <p>I am stuck in pset2 on cs50 , and honestly I think I am missing alot of stuff, I dont know if I can go forward in the course without being able to truely understand some basics. 
  I am trying to get this done and then I think I will pause and still learn some basics about c. 
  I need help with this as well as more commentary that I would be most grateful for.</p>
  
  <p>so basically here's my code </p>
  
  <pre><code>#define _XOPEN_SOURCE
  #include &lt;cs50.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;crypt.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;unistd.h&gt;
  
  bool crack(string given_hash);
  
  
  int main(int argc, string argv[])
  {
      if (argc != 2)
      {
          printf("Usage ./crack hash\n");
          return 1;
      }
  
      if (!crack(argv[1]))
           return 1;
   }
  
  bool crack(string given_hash)
  {    
      string Alphabet = "abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ";
      char key[6];
      char salt[3];
      salt[2] = '\0';
  
      for (int x = 0; x &lt; 2; x++)
      {
          salt[x] = given_hash[x];
      }
  
      // single-letter keys.
      for (int i = 0; i &lt; 52; i++)
      {
          key[0] = Alphabet[i], key[1] = '\0';
          string new_hash = crypt(key,salt);
          if (strcmp(new_hash, given_hash) == 0)
          {
              printf("you got the key: %s\n",key);
              return 0;
          }
      }
  
      // for 2-letter keys.
      for (int i = 0; i &lt; 52; i++)
      {
          key[0] = Alphabet[i], key[2] = '\0';
          for (int j = 0; j &lt; 52; j++)
          {
              key[1] = Alphabet[j]; 
          }
          string new_hash = crypt(key,salt);
          if (strcmp(new_hash, given_hash) == 0)
          {
              printf("you got the key: %s\n",key);
              return 0;
          }
      }
  
      // for 3-letter keys.
      for (int i = 0; i &lt; 52; i++)
      {
          key[0] = Alphabet[i], key[3] = '\0';
          for (int j = 0; j &lt; 52; j++)
          {
              key[1] = Alphabet[j];
              for (int k = 0; k &lt; 52; k++)
              {
                  key[2] = Alphabet[k];
              }
          }
          string new_hash = crypt(key,salt);
          if (strcmp(new_hash, given_hash) == 0)
          {
              printf("you got the key: %s\n",key);
              return 0;
          }
      }
  
      // for 4-letter keys.
      for (int i = 0; i &lt; 52; i++)
      {
          key[0] = Alphabet[i], key[4] = '\0';
          for (int j = 0; j &lt; 52; j++)
          {
              key[1] = Alphabet[j];
              for (int k = 0; k &lt; 52; k++)
              {
                  key[2] = Alphabet[k];
                  for( int l = 0; l &lt; 52; l++)
                  {
                      key[3] = Alphabet[l];
                  }
              }
          }
          string new_hash = crypt(key,salt);
          if (strcmp(new_hash, given_hash) == 0)
          {
              printf("you got the key: %s\n",key);
              return 0;
          }
      }
  
      // for 5-letter keys.
      for (int i = 0; i &lt; 52; i++)
      {
          key[0] = Alphabet[i], key[5] = '\0';
          for (int j = 0; j &lt; 52; j++)
          {
              key[1] = Alphabet[j];
              for (int k = 0; k &lt; 52; k++)
              {
                  key[2] = Alphabet[k];
                  for(int l = 0; l &lt; 52; l++)
                  {
                      key[3] = Alphabet[l];
                      for(int m = 0; m &lt; 52; m++)
                  {
                      key[4] = Alphabet[m];
                  }
              }
          }
      }
      string new_hash = crypt(key,salt);
      if (strcmp(new_hash, given_hash) == 0)
      {
          printf("you got the key: %s\n",key);
          return 0;
      }
    }
  }
  </code></pre>
  
  <p>now I dont know what I am doing wrong , I know this error is due no no returning thing in a non void function, but how do I fix it ? </p>