You are just storing the raw password in code. It would take about 5 seconds to crack this.
If you are just storing one password and you are going to give this software to a few friends, then the best method will be to store the password hash (checksum) in code and when the user enters the password, generate a new hash and compare them. Such an implementation cannot be cracked.
Also, the way you get the password input by the user is not good, do something like this instead:
Code Block
int main(void)
{
//assuming the pin is an integer
int
* pin = new int(1234), input;
scanf_s(
"%d",&input);
return
input==*pin;
}
In the above code, I didn't demonstrate how to hash the password and validate it, etc. I was just improving on your previous logic.