Hello,
I am working on a program that requires a password. I am using:
to have to user imput the password.Code:#include<iostream.h> #include<conio.h> #include<fstream.h> #include<ctype.h> #include<stdio.h> #include<string.h> int main() { int ch; char pword[BUFSIZ]; int p=0; puts ("Enter Password: "); while ((ch = getch()) != EOF && ch != '\n' && ch != '\r' && p < sizeof(pword) - 1) { if (isalnum(ch)) { putchar('*'); pword[p++] = ch; }
The problem is i cant verify the password, i have tried: if else, while, and switch case.
Can some one please tell me how to verify the password or if there is a better way to ask for imput.
Thanks,
-KJ Magic