title: Compiler error: cannot convert char* to char
body: <p>i am trying to create a function like <code>strlen()</code> in string.h </p>
  
  <p>It's giving me the error <code>can not convert char* to char</code></p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  
  int xstrlen(char string);
  
  void main(void) {
    char string[40];
    puts("Enter string:");
    gets(string);
    printf(" %s is the length of %d", string, xstrlen(string));
  }
  
  int xstrlen(char string[]) {
    int i;
    for (i=0; ; i++) {
      if (string[i] == '\0')
        break;
    }// for ends
    return i;
  }
  </code></pre>