use a char for the datatype, however, i need to compare it to integers, rather than actual ascii characters, if i cast it to an int - it would take 4 bytes now, so i'm unsure if it'll work. how do i compare them? because i highly doubt there's a 1 byte int
It's a char
I think you can compare it with an integer without casting the character to int type
Uint8_t is what u looking for?
might be but this worked too
c will cast your char to an int. a char is just another integer type like int. But I'm guessing you'd want to compare '1' with 1 or '2' with 2, which is something different
nope, i wanted to compare character codes, also i don't think it's any different in c++, is it?
you should prefer to compare and use other arithmetic operations with chars with chars and unsigned chars with unsigned chars. you can type an explicit keycode with char(48) or (unsigned char)(48)
Обсуждают сегодня