0
Can you please help me with my Problem here?
What I want to do is:

1. Input Username & Password (Make Password in Asterisk (*))
2. If it is True / Right Proceed to the Main Program
3. Else If False/Wrong give another Trial (Do you want to try again? Continue? (Y/N)
4. If ‘Y’ then go back to No.1
5. Else If ‘N’ then  exit program

The Error is this:
A. The Password is not masked in Asterisk (*)
I’ve tried to use this:
for(int i=0;i<8;i++)
    {
        pass[i]=getch();
        printf("*");
        pass[10] = passWord;
    }

But whenever I put a Wrong password as long as it is 8 letters and the Username is right It would still continue to Login! A Pain in the neck! HAHA



 B. Whenever Inputted “N” for the Trial Question.. It would still continue to the Main Program... 



I’ve  attached some codes of what I’ve done so far.

Can Somebody help me with this? 
Any response would be greatly appreciated!
Thanks in advance!

Edited by pritaeas: Moved.

Attachments
3
Contributors
2
Replies
25
Views
3 Years
Discussion Span
Last Post by iamthwee
0

You're using getch to take the input, so you can't compare that input using the '==' operator as it isn't a string.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.