0

About size int in C

As we all know integer of 4 bytes i.e. 2^4=16 bits.... but it's allocate 32 bits in memory as 1 byte for sign representation..... but we can re present sign by 1 bit also...... so, why to use whole 8 bits?

2/3/2020 3:22:06 AM

DeWill

3 Answers

New Answer

+3

Bits calculation goes like this; sizeof(<type_name>) * <bits_per_byte> So when size of `int` type was 4; 4 * 8 => 32 bit integer And the sign marker is just 1 bit, not 1 byte (8 bits)

+1

Ipang thanks buddy..... 👍🏻

0

You're welcome buddy 👌