How do i get the code to loop?

if i have a programn requesting a password and the password is incorrect it simply moves on and ends the code. how can i get it to start at the beginning after a incorect attempt?

Code: please enter code
me: types 454
Code: incorrect code! Please try again

Something like that

Thanks in advance!
1
2
3
4
5
while (user != code)
{
   cout << "ERROR: Invalid code. Try again.\n >"
   cin >> user;
}
Thank you very much!
Topic archived. No new replies allowed.