Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`int` type size int C [duplicate]

Tags:

c

integer

int

Possible Duplicate:
Is int in C Always 32-bit?

AFAIK, in Pascal size of Integer depends on the platform (on 32-bit computers it has 32 bits, and on 64-bit computers it has 64 bits).

Is this the same in C (I mean, on 32-bit computers its size is 32 bits, and on 64-bit it is 64)?

like image 741
Patryk Wychowaniec Avatar asked Nov 05 '25 17:11

Patryk Wychowaniec


1 Answers

Pretty much but compiler has control. Use the sizeof operator if you just want to check what is happening in your environment. stddef.h will include types like int64_t (I think in that file) if you need to make sure # of bytes is fixed and not leave this up to environment/compiler.

like image 117
djechlin Avatar answered Nov 07 '25 07:11

djechlin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!