i am trying to create a function like strlen()
in string.h
It's giving me the error can not convert char* to char
#include<stdio.h>
#include<conio.h>
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;
}