title: Output mistake in array
body: <pre><code>int BruteForceStringMatch(char Text[], char Pattern[]){
  
      int TextSize = sizeof(Text) / sizeof(Text[0]); //get size of arrays
      int PatternSize = sizeof(Pattern) / sizeof(Pattern[0]);
      int i;
      for(i = 0; i++; i &lt; TextSize - PatternSize){
          int j = 0;
          while(j &lt; PatternSize &amp;&amp; Pattern[j] == Text[i + j]){
              j = j + 1;
          }
          if(j = PatternSize){
              return i;
          }
      }
      return -1;
  }
  
  int main() {
      char x [] = "if" ;
      char y [] = "aslifee";
  
      int c = BruteForceStringMatch(y,x);
      printf("%d ",c);
  
      getchar();       
  }
  </code></pre>
  
  <p>Hi everyone, I want to match text and pattern by using BruteForceStringMatch function but I get output -1 from computer. Here I should get 3 (because fourth element is matching) but why am I getting -1 which means there is no matching?</p>