Похожие чаты

Hello pls what does uint16_t mean ?

13 ответов

9 просмотров

Unsigned integer 16 bit so you have the range of 0 to 2^15

carlos- Автор вопроса
Alexander
Unsigned integer 16 bit so you have the range of 0...

But what will make anyone declare a variable with such a huge capacity or are they just trying to follow good prog practices

carlos- Автор вопроса
carlos
But what will make anyone declare a variable with ...

Won't int serve close to the same purpose

carlos
Won't int serve close to the same purpose

Int is 2^32 on older machines and 2^64 on modern systems

carlos- Автор вопроса
Avihay B
It's capacity is 16 bits or 2 bytes

Okay...all I'm just confused is that some people declare variable with not definite/ absurd data type....looks at volatile int for example 🤧🤕

carlos- Автор вопроса
carlos
Okay...all I'm just confused is that some people d...

Once upon a time, C had the keywords int, short and long. int was declared as an integer as the native word size of the architecture you are compiling to. And everyone lived in peace... Until you started putting code to different architectures, and was short int 8bit? Or 16bit? yes here and not there, and then everybody tried to kill everyone else because their size was right and the others were wrong! But tiered of the fighting, everyone started using type names with explicit bit count. And it was good enough, and in, I think, 1999, the 98 c standard peace treaty was signed, and there was peace

carlos
Okay...all I'm just confused is that some people d...

Volatile means that the value might change by some external factor ( like a different thread, or by some special register handling, and that the compiler shouldn't make assumptions about the value for optimization purposes

carlos
Won't int serve close to the same purpose

No int is different. The highest number in a signed integer is different. Unsigned integers are mostly used to describe registers with the same width. Signed integers habe one bit that serves as minus sign, so it is different in its structure.

Alexander
No int is different. The highest number in a signe...

It should also be noted that "int" is a platform dependent type. I.e. on one system it may occupy 16 bits, and on another it may occupy 32 bits. Whereas *int*_t declare a type of exactly X bits long.

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

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

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
15
any reference of this implementation?
BitBuddha
29
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Карта сайта