Changeable password lock system

But in this case, the sizeof call will return 6 every time, as it is being declared as a global variable. The allocated length of code_buff1 and code_buff2 in memory will always be 6, even if you later try to put fewer chars into it.

If you put in say 4 chars, the last two chars will be whatever was previously in that memory location. In C++ , I believe this will be just 0's for global variables. (That is 0x00, not ASCII "0")