I just had a very quick look.
I was a little bit surprised, as I expected the array to be characters (that is a c-string) rather than an array of integers. But that's not important.
One comment pow(2.0,i) is slightly overworked, since a simple bit shift will do the same thing faster and more simply: 1<<i. That requires i to be an int rather than a double, but that's no bad thing either.