I'm writing a program that converts a binary string to decimal. I wanted to validate my output before I get really started on this method. I have the following code:

```
int get_val()
    {
        int sum =0;
        for(int num_bits = size; num_bits>0; num_bits--)
        {
            printf("String sub %i is %i\n", num_bits, int(bin[num_bits]));
        }
    }

```

When I input a string of 16 zeros, I get the following output:

```
String sub 16 is 24
String sub 15 is 0
String sub 14 is 0
String sub 13 is 0
String sub 12 is 23
String sub 11 is 0
String sub 10 is 0
String sub 9 is 0
String sub 8 is 22
String sub 7 is 0
String sub 6 is 0
String sub 5 is 0
String sub 4 is 21
String sub 3 is 0
String sub 2 is 0
String sub 1 is 0

```

Why would I bet getting different values if I input all zeros?

EDIT: bin is "0000000000000000"