Hi guys writing a program for my university course that need to check a user input password against one saved in the program. So far it always returns incorrect and I'm not sure why.
Code:#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char Password[4], UserInput[4]; Password[4] = "fred"; printf("Please enter your password: "); scanf("%s", UserInput); if (Password == UserInput) { printf("correct"); } else { printf("incorrect"); } getchar(); return 0; }