[英]Showing error in C program : warning: comparison between pointer and integer
#include <stdio.h>
#include <strings.h>
int main()
{
char a;
printf("Enter the traffic signal light :");
scanf("%c", &a);
if(a=="Red")
{
printf("STOP!!!");
}
else
{
printf("GO!!!");
}
return 0;
}
//I am in the beginning stage of coding. //我处于编码的开始阶段。 I am unable to understand the error, kindly please guide me.
我无法理解错误,请指导我。
您将a
声明为char
并与字符串“RED”进行比较?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.