title: expected ‘const char *’ but argument is of type ‘char **’ in C
body: <p>I am trying to write a function which searches the array looking for the specified key.The argument n specifies the effective size of the array,which must be sorted according to the lexicographic order imposed by strcmp.If the key if found,the function returns the index in the array at which that key appears.So ,it can return the index of the substring.However,it come two errors which I can't fix with.Please help.</p>
  
  <pre><code>jiebin@jiebin-ThinkPad-Edge-E530:~/Program_C/programming_abstractions_in_c/FindStringInSortedArray$ gcc FindStringInSortedArray.c -o FindStringInSortedArray
  FindStringInSortedArray.c: In function ‘FindStringInSortedArray’:
  FindStringInSortedArray.c:7:3: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
  /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘char **’
  jiebin@jiebin-ThinkPad-Edge-E530:~/Program_C/programming_abstractions_in_c/FindStringInSortedArray$
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  int FindStringInSortedArray(char *key,char *array[],int n)
  {
    int mid,cmp;
    int low=strlen(array)-n;
    int high=n;
    if(low &gt; high) return(-1);
    mid = (low+high)/2;
    cmp = strcmp(key,array[mid]);
    if(cmp==0) return(mid);
    if(cmp&lt;0){
      return(FindStringInSortedArray(key,array,n/2));
     }else{
      return(FindStringInSortedArray(key,array+n/2,n));
     }
  }
  
  int main()
  {
    char key[2]="ab";
    char *array[10]={"ab","bc","cd","de","ef","fg","gh","hi","ij","jk"};
    int test=FindStringInSortedArray(key,array,10);
    printf("Result:%d\n",test);
    return 0;
  }
  </code></pre>