Question 12
Back to Exercise
What does unsigned _BitInt(12) x; declare in C23?
- A An array of 12 bits
- B A 12-byte integer
- C An unsigned integer with exactly 12 value bits, which wraps modulo 4096 Correct
- D A bit-field outside a struct is invalid
Correct Answer: Option C
_BitInt(N) gives integers of an exact bit width – useful for hardware registers, FPGAs and protocols. An unsigned one wraps modulo 2ᴺ; unlike small types, a _BitInt is not promoted to int.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!