我在调用一个开源库的时候发现参数是这样的:a NULL-terminated array of strings ,脑子一下转不过弯来,google后发现。。。
方法:const char *argv[] = {"foo", "bar", NULL };
可参考:http://stackoverflow.com/questions/2750846/correct-way-to-initialize-a-null-terminated-array-of-strings-in-c
我在调用一个开源库的时候发现参数是这样的:a NULL-terminated array of strings ,脑子一下转不过弯来,google后发现。。。
方法:const char *argv[] = {"foo", "bar", NULL };
可参考:http://stackoverflow.com/questions/2750846/correct-way-to-initialize-a-null-terminated-array-of-strings-in-c