What is the sizeof(char)
in a 32-bit C compiler?
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Answer:
a) 1 byte
Explanation:
In a 32-bit C compiler, the sizeof(char)
is always 1 byte. The size of a char
is defined by the C standard and is independent of the system architecture, making it 1 byte on any platform. This is the smallest addressable unit of memory, and it can store a single character or a small integer value.
Understanding the size of data types like char
is important for memory management and data manipulation in C programming.