title: Compare two strings character by character in C
body: <p>I have one 'simple' (I hope) question. I am actually coding some little program and I need to compare two strings, same length, but different letters like</p>
  
  <pre><code>Eagle
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Hdjoh
  </code></pre>
  
  <p>I want to compare the first letter of the first string with the first letter of the second string,
  the second letter of the first string with the second letter of the second string etc..</p>
  
  <p>I started to do like this:</p>
  
  <pre><code>for(i=0, i&lt;N, i++){
          for(j=0, j&lt;N, j++){
              if(string1[i]==string1[j] etc.. etc..
          }
      }
  </code></pre>
  
  <p>I see clearly that it doesn't compare first letter with first letter, second with second etc..</p>
  
  <p>So maybe anyone have an idea how can I do this? (Without using any functions of string.h, i want to do this ''on my own'').</p>
  
  <p>Maybe its a stupid question but im still a novice in C so...</p>
  
  <p>Ah and the last thing, I define the two strings with 5 characters in my example, but it could be more than 5 vs 5..</p>
  
  <p>Thanks by advance for the ideas.</p>
  
  <hr>
  
  <p>Edit 1 :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define N 20
  
  int main()
  {
      unsigned char string1[N], string2[N];
      int Answer=0, i=0;
      scanf("%s", string1);
      scanf("%s", string2);
  
      for(i=0; i&lt;N; i++){
          if(string1[i]==string2[i]){
              Answer=1;
          }
          else{
              Answer=0;
          }
      }
  
      printf("Answer = %d", Answer);
  
      return 0;
  }
  </code></pre>