title: Can't compare char array vs char array of pointer in C
body: <p>I have some words which i stored in char array of pointer like </p>
  
  <pre><code>char* someWords[]={"a", "about", "above","across", "after", "afterwards",      
  "again", "against", "all",
  "almost", "alone", "along", "already","also","although","always","am","among"} //etc,320 words
  char x[1024]; // used this to read file 
  </code></pre>
  
  <p>Then i read another file and fetch the words in order to compare with someWords, if they are same, i won't count them in. I did something like this.</p>
  
  <pre><code> while (fscanf(fone,"%1023s",x) == 1) { 
      i=0;
  
  
      while(i&lt;541 &amp;&amp; x!=someWords[i]){ //if file contains stopwords.  also tried (strcmp(x,someWords[i])!=0)
  
      i++;
  
      //printf("\n len:%d",strlen(x));
  
      }
      if(i==541)
      {
          printf("\n%s is not stop word ",x);   
  
      }
      else
      {
          printf("\n%s is stop word ",x);
  
      }
  } 
  </code></pre>
  
  <p>The problem is all words printed as " is not stop word" , which made me to figured out that the program can't compare  <code>x</code> and <code>someWords[i]</code>. So what should i do to fix it? Which types of variables should i use? Or should i completely changed my approach of reading file? </p>