我有以下代码:
char *array1[3] =
{
"hello",
"world",
"there."
};
struct locator_t
{
char **t;
int len;
} locator[2] =
{
{
array1,
10
}
};
它可以使用“gcc -Wall -ansi -pedantic”编译。但是使用另一个工具链(Rowley),它抱怨
warning: initialization from incompatible pointer type
在 char **t 所在的行上。这确实是非法代码还是可以?
感谢所有的答案。我现在知道我的问题出在哪里了。然而,它提出了一个新问题: