You haven’t mentioned what error you are getting. But I see these problems:
-
The declaration
char name = "Elham";
is incorrect. It should be
char *name = "Elham";
-
The
if
condition in your code is missing parentheses.
if s[h] == '\0' return -1;
should be:
if (s[h] == '\0') return -1;
Hope this helps!
2
solved Working with Array… cannot figure out the error [closed]