Post compiler error here. There are no psychics here and we cannot know what happened.
In this case it is simple. There are already strncmp function declared in C standard library, so there cannot be another one. Choose different name for it.
put a break point at for loop line , you should see then if the program goes within the for loop scope. Note that you method does not have a default return value , for instance put at least return -1;
Technically that's not an error. It's just saying that it is possible that your function which says it will return an int, might not (n might be 0), in which case nothing would happen.