Calling a function within a function.
I am at the end of a very long program and I have one last thing to do.
That is call an integer function into a string function with one integer parameter:
Those are the two functions I am using. For the sake of time and space I didn't copy the entire pwTest function because it checks about 10 different things.
string pwType (int test_failed)
if ( (pwTest ) == (0))
pw_strength = " strong " ;
else if ( int (pwTest) == (1))
pw_strength = " medium ";
else if (int (pwTest) == 2 || int (pwTest) == 3)
pw_strength = "medium weak" ;
else if (int (pwTest) >= 4)
pw_strength = " weak " ;
int pwTest(string password, bool verbose, int sec1, int sec2 )
Here's what I am trying to do in the main fucntion:
I want the output to be: "Your password is a (one of the for types listed) password."
cout <<"Your password is a " << pwType(pwTest (password, verbose, sec1, sec2)) << " password." << endl;
However, when I call it I am always getting: "Your password is a weak password."
Or when I change it up I often get: "Your password is a 001091 password." or some other random number. Which I am guessing is its location in RAM.
Well, any suggestions would be greatly appreciated!