在C语言中,可以使用==
操作符来判断两个字符是否相等。例如:
#include <stdio.h>
int main() {
char a = 'A';
char b = 'B';
if (a == b) {
printf("a and b are equal.\n");
} else {
printf("a and b are not equal.\n");
}
return 0;
}
输出:
a and b are not equal.