The first location in a string is indexed as a zero. bin[0];//This is the first location.
That means if bin contains 5 characters (for example), it will go from bin[0] to bin[4]
You have to take one off of the size or it will go too far and go past the end of the string.