Hey!
So I have a simple program that measures the length of a string using a for loop.

Code:
#include <stdio.h>

int main(void) {
    unsigned i;
    char str[16] = "ABBA";

    for (i = 0; str[i] != '\0'; ++i);

    printf("Len: %u", i);

    return 0;
}
It works fine, but there's one thing I can't wrap my head around. If I set the initial value of i to 1 inside of the loop the program still outputs 4 in fact it always outputs 4. Even if I set the value of i to something like 2 or 3.

Here's the thing, shouldn't it output 3 if i starts at str[1]? The loop should start at 'B' and finish at 'A' which is three characters. But that's not the case for some reason. Can anybody explain this to me?

Thanks in advance.