:sl:
You are not comparing it with a stored password. And you are not displaying the pwd where you say:
// output the password (just for testing)
cout << endl << "Welcome Ahmed Ali";
If you are testing it, then there should be a
<<password also in that statement.
Another point that I noticed:
// now fill the rest of the array with '\0' (NULL) character
for (i; i < strlen(password); i++)
password[i] = '\0';
There is no need for the loop here, since you are not changing the value of the index
i after entering the password in the previous loop. And since it was counting the no. of chars entered, it will be pointing at the end of the password already. You can simply write
password[i] = '\0'; and it will close the string. Try it.
Don't you think this thread should be in the Educational Issues section?
Its late night here. If there are other queries, I will try to check tomorrow inshaAllah.
:w: