1.
//.h
extern const char* tb_1[][2];
extern char tb_2[][2];
//.cpp
printf("--- %s ----\n",tb_1[2][1]);
printf("--- %c ----\n",tb_2[2][1]);
tb_1[1][1] = "c";
tb_2[1][1] = '0x22';
//.cpp
const char* tb_1[][2] = { {"abc","def"},
{"0x23","0x55"},
{"第一个","第二个"} };
char tb_2[][2] = {
{'a','b'},
{'c','d'},
{0x11,0x22}
};
2.
const char* const tb_3[][2] = { {"abc","def"},
{"0x23","0x55"},
{"第一个","第二个"} };
#include "test_const.cpp"
printf("--- %s ----\n", tb_3[2][1]);
标签:----,---,const,char,二维,cpp,tb From: https://www.cnblogs.com/sansuiwantong/p/17066110.html