在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.