problem with my scanpass function
Posted: Sat Nov 03, 2007 6:59 am
this code accept only four characters and then print the two phrases
you are %s
you are not mohammed
!!
you are %s
you are not mohammed
!!
Code: Select all
#include<stdio.h>
#include <conio.h>
main()
{
char name[10];
char name2[10]="mohammed";
char mypass[10];
char mypass2[10]="0123456789";
clrscr();
scanf("%s",&name);
scanpass(mypass[10]);
if(name[10]==name2[10] && mypass[10]==mypass2[10])
{
printf("hello %s",name);
}
else
{
printf("you are %s you are not mohammed",name);
}
getch();
}
scanpass(char pass[10])
{
int counter;
for(counter=0;counter<10;counter++)
{
pass[counter]=getch();
printf("*");
counter++;
}
return pass[10];
}