int main(){
char *mem = malloc(sizeof(char)*10);
for(size_t i = 0; i < 10; i++){
mem[i] = 0xFF;
}
for (size_t i = 0; i < 10; i++){
if(mem[i] == 0xFF){
printf("True\n");
}
}
}
This doesn't print out True. However, when mem is declared as unsigned char, True is printed. How does comparision take place? I thought that == compares bit values, so why does it matter if it is char/unsigned char?