我要检查,如果用户输入等于某个值检查是否变量是一定值
#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;
}
的问题是什么我写我还得到了“你没有”打印出来。我如何做到这一点,如果用户在if语句中写入值,它会返回true。
谢谢