How to determine the size of an array of strings in C++?

后端 未结 8 729
野的像风
野的像风 2020-12-30 06:57

I\'m trying to simply print out the values contained in an array.

I have an array of strings called \'result\'. I don\'t know exactly how big it is because it was au

8条回答
  •  不知归路
    2020-12-30 07:24

    template< class T, size_t N >
    std::size_t Length(const T(&)[N])
    {
        return N;
    };
    
    std::cout << Length(another_array) << std::endl;
    

提交回复
热议问题