【发布时间】:2014-03-01 23:54:28
【问题描述】:
我正在使用 Microsoft Visual Studio Express 2013,试图做一些事情......代码实际上可以运行,但仍然存在错误,代码为 C4047:'char *' differs in levels of indirection from 'char[24][50]'
是这样吗?
忽略警告,该程序按我预期的方式运行,没有任何问题。我只是想了解和了解背后发生的事情。 (stale) 警告表示我在函数中传递多维数组的行。这是该函数的参数行:
void mass_assigner(
WORD * translations,
char * labels,
char * PermBannedKeys,
char * TempBannedKeys,
char * Cooldowns
)
{ ... }
这是我从main 中调用它的方式:
...
mass_assigner(
translations,
labels,
PermBannedKeys,
TempBannedKeys,
Cooldowns
);
...
其中labels 是char labels[24][50] = { ... };
真正的问题是什么?据我所知,多维数组不是数组数组(具有多级间接),而只是一个数组(具有单级间接)。
【问题讨论】:
-
labels是一个char **/指向字符串的指针 => 指向指针的指针
标签: c string multidimensional-array multiple-indirection