|
Check it out
I have run this code in VC++ 6.0.
It works. Please check it out.
#include<conio.h>
#include<stdio.h>
#include<string.h>
//#include<graphics.h>
main()
{
int c;
int i;
char pwd[80];
// clrscr();
printf("ENTER PASsword");
for ( i = 0; i < 79 && (c = getch()) != '\r'; ++i )
{
pwd[i] = c;
putch('*');
}
pwd[i] = '\0';
printf("\n");;
if ( strcmp(pwd, "liza") == 0 )
{
printf("Correct \n");
}
else
{
printf("INCorrect \n");
}
return 0;
}
I hope this helps you
|