What would following typedef mean, and why would it be required
typedef unsigned long int ULONG;
how different is it from
typedef unsigned long ULONG;
For gcc sizeof int = 4, sizeof long = 8, and sizeof ULONG = 8.
They are the same. Because long
is a modifier for an int
by default, int
can be omitted. The same goes for short
and short int
, unsigned
and unsigned int
, etc.
The essential thing to understand here is that long
, short
and unsigned
are type modifiers, not types themselves, unlike int
, char
, double
, etc.
There's no difference at all. long
is synonymous with long int
(just as short
is with short int
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With