Похожие чаты

Is the inttypes.h header builtin or it's in libc? How about

stddef.h?

22 ответов

52 просмотра

Both belongs to the C standard library

You don't have to link anything to use it

Mahdi- Автор вопроса
Mahdi- Автор вопроса
Thomas
You don't have to link anything to use it

The types are literally a bunch of typedefs. LOL.

Mahdi
screenshot The types are literally a bunch of typedefs. LOL.

What did you expect? Why is that surprising to you?

Mahdi- Автор вопроса
BinaryByter
What did you expect? Why is that surprising to you...

"Size of C types like int, short, long are platform-dependent"

Mahdi
"Size of C types like int, short, long are platfor...

But stdint types are not. uint8_t is literally 8 bits without sign same with int16_t, uint24_t or int32_t, naming someones

Mahdi
"Size of C types like int, short, long are platfor...

And these .h files are platform-dependent too

Mahdi- Автор вопроса
Jose TheFantasyClub
But stdint types are not. uint8_t is literally 8 ...

I know. I'm saying if shot, int, long are platform-dependent type how can a combination of them make a non-platform dependent type?

Mahdi
I know. I'm saying if shot, int, long are platform...

Because the .h file is different for each platform

Thomas
uint24_t 👀

let me check it, i'm writing without proofing

Mahdi
I know. I'm saying if shot, int, long are platform...

So on platforms where int is 4 bytes, int32_t can use it, on platforms where int isn't 4 bytes, int32_t must use something else

Thomas
uint24_t 👀

yep, checked and wrong from my part: The definitions in <stdint.h> put requirements on the types it names, so int16_t must have a width of exactly 16, and INT16_MAX must be 32767. Butthere are no equivalent requirements on types such as int24_t or int128_t. So it is possible for int24_t to be a 16 bit type, or int_least128_t to be a 64 bit type. This is not in the interests of either the implementer or the user of an implementation. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n851.htm

Mahdi- Автор вопроса
Thomas
So on platforms where int is 4 bytes, int32_t can ...

Explain this platform dependency. What exactly do you mean by that? Is it related to OS? ARCH? 32bit or 64bit? What are those platforms that make exceptions?

Mahdi- Автор вопроса
Thomas
OS+ARCH

Wdym by arch? arm/x86_64/powerpc or 32bit/64bit?

Mahdi
Explain this platform dependency. What exactly do ...

macOS has a different size for long than windows / linux I think

Mahdi
Explain this platform dependency. What exactly do ...

Byte didn't always mean 8bits, so some platforms used different widths when referring to bytes, but nowadays it is more or less normalized that byte means 8bits

Jose TheFantasyClub
But stdint types are not. uint8_t is literally 8 ...

One more detail - these are minimally guaranteed sizes of each datatype. The maximum is another thing

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
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
Карта сайта