Why this code isn\'t working. Just trying to check if the user input is the same as a password
char *pass;
printf(\"Write the password: \");
scanf(\"%s\", p
#include
main()
{
int mystrcmp(char *,char *);
char s1[100],s2[100];
char *p1,*p2;
p1=s1;
p2=s2;
printf("Enter the first string..?\n");
scanf("%s",p1);
printf("Enter the second string..?\n");
scanf("%s",p2);
int x=mystrcmp(p1,p2);
if(x==0)
printf("Strings are same\n");
else
printf("Strings are not same..\n");
}
int mystrcmp(char *p1,char *p2)
{
while(*p1==*p2)
{
if(*p1=='\0' || *p2=='\0')
break;
p1++;
p2++;
}
if(*p1=='\0' &&as *p2=='\0')
return(0);
else
return(1);
}
simple code for beginners....