It still won't work. You are comparing char with int:
getBinary[i] is char, and 1 is int.
char != int!!!
It will work. Comparing char with int is allowed.
Worst case is a compiler warning (eg mismatch of precision of operands). A compiler warning means the programmer should check and make sure the code has the intended result, not that it is disallowed.