67. constexpr-ii

Question.7

A developer uses a constexpr value as an array size:

constexpr int NUM_SENSORS = 8;
int readings[NUM_SENSORS];  // Array size from constexpr

Can a const (non-constexpr) variable be used as an array size in C++?

Need Help? Refer to the Quick Guide below

Select Answer