Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard integer types #1

Open
Vishwajith-K opened this issue Apr 5, 2021 · 0 comments
Open

Standard integer types #1

Vishwajith-K opened this issue Apr 5, 2021 · 0 comments

Comments

@Vishwajith-K
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant