See: fooobar.com/questions/671236 / ...
Summary:
#include <array>
const std::array<std::array<float,5>,3>
twitterCounts = {
{1,0,0,0,0},
{0,2,0,0,0},
{0,0,3,0,0}
};
const std::array<std::array<float,5>,3>
TwitterLiveData::data() {
return twitterCounts;
}
You might not want to return the array by value, as this may be too expensive. Instead, you can return an array reference:
const std::array<std::array<float,5>,3> &TwitterLiveData::data();
Anyway, your desired syntax float x = TwitterLiveData::data()[1][1];works.