Похожие чаты

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

stddef.h?

22 ответов

27 просмотров

Both belongs to the C standard library

You don't have to link anything to use it

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

The types are literally a bunch of typedefs. LOL.

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

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

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

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

Raymond
"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

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

And these .h files are platform-dependent too

Raymond- Автор вопроса
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?

Raymond
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

Raymond
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

Raymond- Автор вопроса
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?

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

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

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

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

Raymond
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

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

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

Добрый день. Хочу сделать отрисовку по команде на панели. Почему-то рисуется только при втором вызове. С чем может быть связано, не подскажете? procedure TForm1.FormDblClick(...
Kirill Filippenok
20
а зачем этот вопрос для удаления из чата?
Mёdkinson Medvezhkin
63
А почему в си некоторые вещи работают с двойными кавычками некоторые с одинарными? Нельзя было все сделать с одними или чтоб работало с разными? например чтоб выводить строки ...
.
15
using next image component with s3 image: "url" parameter is valid but upstream response is invalid code: <Image fill src={s...
Fasil
3
Всем привет! Нужен совет от опытных. Переношу свой проект с Делфи 10.2 Токио на Лазарус 3.2 установленный через инсталлятор fpcupdeluxe-x86_64-win64. При импортировании проект...
Дмитрий Завгородний
7
Всем привет! procedure TForm1.FormCreate(Sender: TObject); type TStartEnd = record S: Byte; E: Byte; end; var a, b: TStartEnd; begin {1} a.S := 1; {2} a.E := 2; ...
Руслан Михайлович
10
Всем привет!) я тут новенький и пытаюсь освоить evolution методом тыка. У меня при переходе между папками файлов выскакивают вот такие уведомления Можете подсказать как их от...
Диман Samoed
10
Эх кто-то пришел и весь праздник испортил :( You need complex FBX scene importing setup to change things on import? good luck with that. You need navigation and pathfinding? g...
Serg Gini
5
Friends, how can I find my Wazirx wallet address?
Silm Silm
31
Всем привет! Подскажите. Я написал приложение на Delphi 10.2 Tokyo под Windows 10. И передо мной стал вопрос о том чтобы сделать это приложение кроссплатформенным (под Linux и...
Дмитрий Завгородний
24
Карта сайта