What does volatile const uint32_t *status describe?
const restricts the program; volatile says the value may change outside the program (hardware, another core). A read-only hardware status register is the classic example.
C Const · Exercise 1 of 4
Twelve multiple-choice questions on const variables, const with pointers, const parameters, const vs #define, casting away const, volatile const and C23 constexpr. Pick an option to check your answer instantly.
What does volatile const uint32_t *status describe?
const restricts the program; volatile says the value may change outside the program (hardware, another core). A read-only hardware status register is the classic example.
In C23, which use is valid for constexpr int N = 8; that is not valid for const int N = 8;?
A constexpr object is an integer constant expression, so it can appear wherever C requires one – case labels, static array sizes, bit-field widths. A plain const int cannot.
Timed online tests with instant scores and explanations.