c++ - How to get an array's size? -
there array :
... int score[3]; ... score[0] = 6; score[1] = 4; score[2] = 7; how array's number of elements ? ( here obvious want ask question in general )
several ways:
std::distance(std::begin(score), std::end(score))std::extent<decltype(score)>::value- c++17 (n4280):
std::size(score)
see this answer.
Comments
Post a Comment