title: How to compare 2 char in C
body: <p>Why this don't work? months[5] == name is equal. <code>months[5]</code> is <code>Jun</code> and <code>name</code> is <code>Jun</code> but <code>if</code> never execute...</p>
  
  <pre><code> int getMonthNum(char * name){
      char *months[12] ={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
      char *pointertoarray = &amp;months;
      int i;
          for(i = 1; i &lt;= 12; i++){
              if(months[5] == name){
                  return i;
              }
          }
      return i;
      }
  </code></pre>