各位路过的大神们帮我看一下这个程序为啥不能运行,谢谢。
#include <stdio.h>void main()
{
char answer;
printf("Where does light come from?\n");
printf("a>the sun\n b>themoon\n c>Jupiter\n d>Mars\n");
printf("\nPress a/b/c/d to indicate your answer\n");
scanf("%c",&answer);
if(answer=="a")
printf("you are right");
else
printf("game over");
}
*******************************************************************************
Compiling...
Cpp1.cpp
D:\Program Files\class\新建文件夹 (5)\Cpp1.cpp(9) : error C2446: '==' : no conversion from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Cpp1.obj - 1 error(s), 0 warning(s)