You never modify the value of inValid. You set it to true at the top of the file and then later test it with an if(). Your code will *always* execute


cout << input << " is not a binary number."...