
Well, it should say "You can change a 4 digits code to a 6 digits code"...
But he is saying the same thing I said above. He only used sizeof to make it easier for you to change the length. That should not be having an affect on the code not working.
Are you saying it works correctly when you use a 4 digit code? Like this:

But it does not work when you do this?:

Because it should work either way. The second way is the same as doing this:

If you are saying that is not working... Then tell us how it is failing? What happens when you run it?