我有以下代码:
char *array1[3] =
{
"hello",
"world",
"there."
};
struct locator_t
{
char **t;
int len;
} locator[2] =
{
{
array1,
10
}
};
Run Code Online (Sandbox Code Playgroud)
它用"gcc -Wall -ansi -pedantic"编译好.但是对于另一个工具链(Rowley),它抱怨
warning: initialization from incompatible pointer type
Run Code Online (Sandbox Code Playgroud)
在char**t的行上.这确实是非法的代码还是没问题?
谢谢你的回答.我现在知道我的问题在哪里.但是,它提出了一个新问题: