Hey I have a problem with this program
#include <stdio.h>
int main( void )
{
char password;
password = NULL;
int n;
n = 1;
while (n != 6)
{
printf("Enter the password. \n");
scanf("%d", password);
if (password = "default")
{
printf("It was a correct password \n");
}
else
{
printf("Sorry wrong password \n");
n = n + 1;
}
return 0;
}
}
when I run it I get correct password for anything I type.
I would even appreciate if you could tell me how to convert this into a android app, I do have c4droid but I wanted to add things like factory reset if password is wrong for 6 times and it should quit the app as soon as the password is correct.
Any help would be appreciated. Thanks.
#include <stdio.h>
int main( void )
{
char password;
password = NULL;
int n;
n = 1;
while (n != 6)
{
printf("Enter the password. \n");
scanf("%d", password);
if (password = "default")
{
printf("It was a correct password \n");
}
else
{
printf("Sorry wrong password \n");
n = n + 1;
}
return 0;
}
}
when I run it I get correct password for anything I type.
I would even appreciate if you could tell me how to convert this into a android app, I do have c4droid but I wanted to add things like factory reset if password is wrong for 6 times and it should quit the app as soon as the password is correct.
Any help would be appreciated. Thanks.