I've made a program, and I want to password protect it, i.e. it would run only when the correct password is entered. . .
The password should be a string, e.g. raj.
And while entering, the a "*" should be printed instead of the characters entered. . .
Basically, you make a loop that only allows you to exit when you've entered the correct string, which we have set to "raj". If the user enters anything else, the function starts over and prompts the user again.
1 2 3 4 5 6 7
passwordcheck(); //this makes the user have to get the password before moving on
//rest of your main function