Not only what the above have stated, but Password is declared as type int as well. Either this forces you to convert all char to ints, or to only enter integers are your password. Since you have included code to check to see if at least one of char is a digit, I'm assuming you at least used the wrong type for Password and instead wanted to use char.
Also, it helps alot to used the code tags. That's alot of brackets in there that are near unreadable. :)
Now if Password should include alphabetic chars, then Password should either be type char[] which is a char array, or a string object (which you'll need to #include <string> to use).
With either there's a function that will return the length of Password as such:
length = strlen(Password);
This code assumes 2 things. 1) That you already declared length as type int (since that's what strlen returns) and 2) that Password is declared as a type char[] (or char array). Then you can use the
if (Length < 6)
If you are using a string for Password you would do this:
1 2 3
|
string Password;
// cin and stuff here
Length = Password.length();
|
.length is a member function of the string object and returns the number of chars the string contains.
Last, like the others have said, not exactly sure what you are trying to do with the if(Password(Index) lines, or why you'd want to set validPassword to true if the character at (index) falls between 0 and 9. In fact, now that I think of it, even if you used a number only password you'd STILL have to use a char array or string because there's no way to iterate through the different digits of an integer (or any other numeric type) that I'm aware of. So either way, Password is going to have to be a char array or a string.