I want to check if the user input is equal to a certain value
#include <stdio.h>
#include <windows.h>
int main()
{
SetConsoleOutputCP(1252);
SetConsoleCP(1252);
char meningen[100];
printf("Hello \n");
printf("I want you to write 'Simon Anderson'.\n");
scanf(" %[^\n]s", meningen);
if (meningen == "Simon Anderson")
{
printf("Congratilation. You have won the game.\n");
printf("Have a good day");
}
else {
printf("You failed.\n");
}
getchar();
getchar();
return 0;
}
The problem is whatever I write I still get the "You failed" printed out. How can I make it so it returns true if the user wrote as the value in the if-statement?
Thank you