so today I made a program that basically gets the right password from the user. It works well with integers but when I rewrite the code for working with strings it isn't working. I have tried many different ways but nothing works. can anyone help me?
#include <stdio.h>
#include <stdlib.h>
int main() {
char Guess[8];
char Password[] = "password";
int Guesscount = 3;
int Granted = 1;
while (Guess != Password && Granted == 1) {
if (Guesscount > 0) {
printf("Enter password: ");
scanf("%s", Guess);
Guesscount = Guesscount - 1;
if (Guess != Password && Guesscount > 0) {
printf("Wrong Password, you have %d try left.\n", Guesscount);
}
} else {
Granted = 0;
}
}
if (Granted == 0) {
printf("Denied");
} else {
printf("Granted");
}
return 0;
}