void decimal2binary(char *decimal, char *binary) {
//method information goes here
}
这是主要
int main(int argc, char **argv) {
char *data[100];
if (argc != 4) {
printf("invalid number of arguments\n");
return 1;
}
if (strcmp(argv[1] , "-d")) {
if (strcmp(argv[3] , "-b")) {
decimal2binary(temp, data);
}
}
}
现在我得到这个错误
warning: passing argument 2 of ‘decimal2binary’ from incompatible pointer type [enabled by default]
note: expected ‘char *’ but argument is of type ‘char **’
所以它说它们是不兼容的类型,但我必须使用 argv 来获取数据(我被问到)还有其他方法吗?