解决方案如下:
const char* getContent(int row,int column){
const char* temp1[] =
{
"1行1列","1行2列","1行3列","1行4列","1行5列",
};
const char* temp2[] =
{
"2行1列","2行2列","2行3列","2行4列","2行5列",
};
const char* temp3[] =
{
"3行1列","3行2列","3行3列","3行4列","3行5列",
};
const char* temp4[] =
{
"4行1列","4行2列","4行3列","4行4列","4行5列",
};
const char* temp5[] =
{
"5行1列","5行2列","5行3列","5行4列","5行5列",
};
const char** temp[] =
{
temp1,temp2,temp3,temp4,temp5,
};
const char** tab =temp[row];
return tab[column];