Похожие чаты

Hi, i'm reading one byte from a file, so i

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

8 ответов

26 просмотров

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?

artemetra 🇺🇦-[less active] Автор вопроса
Hsn
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

artemetra 🇺🇦-[less active] Автор вопроса
Avihay B
c will cast your char to an int. a char is just an...

nope, i wanted to compare character codes, also i don't think it's any different in c++, is it?

artemetra 🇺🇦 [less active]
nope, i wanted to compare character codes, also i ...

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)

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта