how to keep an uknown in the memory

how to declare an unknown in c++ and keep it in the memory and change it later,for example:i built a program that don't start until u enter the right password,but the problem is that i don't know how to make it change the password,the program suppose to take the password from me the first time then keep it in the memory and ask me for that password every time i open it,i mean if i entered the password first time as (12345),the program shouldn't start unless i entered (12345),i also used if loop to give myself the chance to change the password,but i don't know if i can declare an unknown and keep it in the memory and use it every time i open the program,and have the chance to change it later,can i???,please help me,if there is an answer tell me with the steps please
1. you should never store a password
2. you should never store a password
3. You can hash the password and store the hash in a file, and then compare the hashes when the user tries a password. That way they can't just open the file and see the password.
4. You probably shouldn't be trying to practice password semantics like this, it is more often handled through the web with servers and databases - it is very poor design to store passwords locally.
why not shtor the passwords is good i dont get it its not bad if no user sees it there
How do you intend to prevent people from seeing the password?
Topic archived. No new replies allowed.