I'm trying to solve a problem found on my C programming book.

```
#include <stdio.h>
char *f (char s[], char t[], char out[]);
int main(void)
{
    char s[] = "ISBN-978-8884981431";
    char t[] = "ISBN-978-8863720181";
    char out[10];
    printf ("%s\n", f(s,t,out));
    return 0;
}
char *f (char s[], char t[], char out[]) {
    int i;
    for (i=0; s[i] == t[i]; i++)
    out[i] = s[i];
out[i] = '\0';
return &out[0];
}

```

As you can see from the code, this code uses as return value &out[0]: does this means that the complete array is used as return value?

```
char *f (char s[], char t[], char out[]);
int main(void)
{
    char s[] = "ISBN-978-8884981431";
    char t[] = "ISBN-978-8863720181";
    char out[10];
    printf ("%s\n", f(s,t,out));
    return 0;
}
char *f (char s[], char t[], char out[]) {
    for (; *(s+=1) == *(t+=1);)
            *(out+=1) = *s;
    *(out+1) = '\0';
    return out;
}

```

This is my proposed solution, but while the proposed code returns "ISBN-978-88", mine only returns "8".
The array is smaller than the lenght of the string, how the proposed code can work without any kind of overflow?
Thanks for your responses.