View Single Post

  #2 (permalink)  
Old 11-03-2009, 01:26 AM
rasmiranjanbabu rasmiranjanbabu is offline
Junior Member
 
Join Date: Oct 2009
Location: Bangalore, India
Posts: 2
rasmiranjanbabu is on a distinguished road
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
Reply With Quote