Reputation: 20301
I have the following c code:
int argv = 2;
char **argv = {"test arg 1",
"test arg 2"};
When I compile it, I get teh following warning:
warning: initialization from incompatible pointer type [enabled by default]
Can you please tell me what's wrong for my initialization?
Thank you.
Upvotes: 0
Views: 1323
Reputation: 145839
char **
is a pointer type not an array type.
Use an array type:
char *argv[] = {"test arg 1", "test arg 2"};
Upvotes: 3