Question.4
A developer tries to validate a runtime sensor reading:
int reading = read_adc(); static_assert(reading > 0, "Reading must be positive");
Will this compile?
Select Answer
Yes -- static_assert checks any condition
No -- static_assert requires a compile-time constant expression; reading is a runtime variable
Yes -- but only with constexpr
Yes -- on embedded targets with hardware assertions