Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我一直试图在 C 中创建一个对象,它本质上是两列空字符数组。它的内容类似于
char * strings[3][2] { {"thing1", "value1"} {"thing2", "value2"} {"thing3", "value3"} }
...除了实际的 char *s 将是具有固定长度的空数组,而不是初始化的字符串,即每个字符串实际上都类似于“char string[6]”。
我一直在寻找一段时间,但我正在干涸。有人会碰巧知道创建这样一个对象的语法吗?
也许是这样的:
typedef char sixchars[7]; sixchars strings[3][2] = { { "thing1", "value1" } , { "thing2", "value2" } , { "thing3", "value3" } };