I am trying to define and use a 2-d array in C++
const float twitterCounts[][5] = {
{1,0,0,0,0},
{0,2,0,0,0},
{0,0,3,0,0}
};
returning it like this:
const float ??? TwitterLiveData::data() {
return twitterCounts;
}
and using it like this
float x = TwitterLiveData::data()[1][1];
What is the proper signature for the static accessor?
You cannot return an array, but you can return the pointer to its first element or reference to the array. You just have to put the correct type in the signature:
Or maybe