code recalling if statement for some reason

Hi I am having a problem with my account creation system, I added an email confirmation to it, and now when the password is typed wrong first, and then retried correctly, when the code gets to the end of the function, rather than exiting out, it goes back to an if statement in the function for some reason. I dont know if anyone will be able to help without me posting all the code, but i will post what I can in hopes someone might have an idea what the issue may be.

The problem is occuring with the if(parseFile(.....
If an account has been created correctly, with the password and the password retry entered correctly the first time, everything works fine, the createAccounts function exits fine. But if the retry password is entered wrong, and then correctly, when createAccounts gets to the end of the function, rather than exiting, it seems to recall the parseFile if statement. And it seems to have to do with the if(password != passwordRetype) if statement, as if i comment that out, it works fine and exits fine, but i can not find why this is, or how to fix it. Any ideas on how to fix this issue would be appreciated


1
2

}
Last edited on
1
2
3
4
5
6
7
if (password != passwordRetype)
	{
		cout << "Passwords do not match, try again\n";
		password = "";
		passwordRetype = "";
		createAccount();   //<<<<< NO!
	}

Well that's what you get when you try to use recursion to implement a while loop.

Put an actual while loop around the code you want to repeat.

I will change the code and see if that solves the issue, but could you explain why that would cause my issue, why can i not call my function again in that manner?
Well thanks for deleting all the code, now I can't tell you what you were doing wrong.
Based on the code that you provided the answer is 42.

https://www.youtube.com/watch?v=aboZctrHfK8
Topic archived. No new replies allowed.