Sorry, your program is neither stable nor secure, and lacks even the most basic level of encapsulation. Read up on buffer overflows and how to prevent them, and consider storing a hash or some such...