1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#include <string>
constexpr std::size_t NROWS = 3 ;
constexpr std::size_t NCOLS = 5 ;
using array_type = std::string[NROWS][NCOLS] ;
const array_type& foo() // return reference to const
{
static const array_type array // static
{
{ "zero", "one", "two", "three", "four" },
{ "black", "red", "green", "blue", "white" },
{ "cat", "dog", "parrot", "cow", "deer" }
};
return array ;
}
|