Похожие чаты

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 ответов

3 просмотра

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)

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

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

@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGCY | BattleVerse L1 | BitWin
1
Did @Beeker really get banned? That's ridiculous. He's one of the few left here with half a brain and you might not always like his narrative @dgb_ycagel , but he often keeps ...
Leroy Gerrits
1
Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
async login(req: Request, res: Response, next: NextFunction): Promise<void> { try { const { errors, input } = await RequestValidator(LoginRequest, req.body...
. .
1
Я тут за тем, чтобы задать вопрос, так как не знаю ассемблер, учу с/с++. Короче, насколько дорога операция перехода в функцию при ее вызове? Дело в том, что в с++ есть макросы...
Максим Рябцев
12
А какие чаты вообще в ходу? Auto aim? И что еше
do you think you're better off alone? А
13
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
hello friends. Do you know how can I learn getx? I have a software project that I should deliver it up to 5 weeks later and I need to learn firebase too. I will be thankfull
AmirHossein Razavi
15
Привет, нужен совет старших товарищей. Есть глобальная переменная var DefaultDataFolder:string; инициализируем DefaultDataFolder:='a:\_OUT\'; есть примитивная процедур...
Max Otto
14
We heading to 1.1$ 🤔?
CryptoBo$$
35
Карта сайта