[Solved] Working with Array… cannot figure out the error [closed]


You haven’t mentioned what error you are getting. But I see these problems:

  1. The declaration char name = "Elham"; is incorrect. It should be
    char *name = "Elham";

  2. 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]