title: Function would not return 0, cant find error in logic
body: <p>I am not sure why the following code isnt working.</p>
  
  <p>I try to use gcc to compile it <code>gcc -Wall -o test test.c</code>, it gives me warning message: control reaches end of non void function.</p>
  
  <p>But I couldn't find the error so I tried to compile it ignoring the warning messages, and tested the program out using <code>./test 1234321</code> after compiling it using <code>gcc -o test ispalidrome.c</code></p>
  
  <p>But instead of returning 0 (that it should to my understanding because it didn't trigger any of the if statements to return 1), it returned a random value, 46, 52, 84 etc.</p>
  
  <p>The main logic behind the program is exactly as required, I just can't tell why it isn't exiting properly.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(int argc, char **argv){
      if (argc != 2){
          fprintf(stderr,  "Usage: %s \"string\"", argv[0]);
          return 1;
      }
      else{
          int i = 0;
          while( '\0' != argv[1][i] ) i++;
          char *start=argv[1];
          char *end=&amp;start[i-1];
  
          while (start&lt;end){
              if (*start != *end){
                  break;
                  return 1;
              }
              printf("%c is the same as %c\n",*start, *end);
              start =start+1;
              end=end-1; 
          }
      }
  }
  </code></pre>