You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why do we need int8_t when we are sure that char consumes same size? Or for that matter why do we need stdint.h itself?
Ans - Till now char on C consumes 1B. But what about int? It varies across machines! So, if you definitely need 32b for your data, then pick uint8_t or int32_t instead of C's keyword based types. With this kind of usage, code change is not required across machines. So the purpose of these types is that, portability. And one more noticeable point is that, these words end with t; which simply means type or typedef.
The text was updated successfully, but these errors were encountered:
Why do we need
int8_t
when we are sure thatchar
consumes same size? Or for that matter why do we needstdint.h
itself?Ans - Till now
char
on C consumes 1B. But what aboutint
? It varies across machines! So, if you definitely need 32b for your data, then pickuint8_t
orint32_t
instead of C's keyword based types. With this kind of usage, code change is not required across machines. So the purpose of these types is that, portability. And one more noticeable point is that, these words end witht
; which simply meanstype
ortypedef
.The text was updated successfully, but these errors were encountered: