问题描述
大家好吧
我需要知道如何传递char数组的元素,例如
argv [0] =。/ run_single_zone
argv [1] =data_pub / my_net.xml
argv [2] =data_pub / zone.xml
argv [3] = my_output.xml
argv [4] =[z< = 10]
到它取一个整数和数组的函数,我的函数是
run_single_zone(argc,argv []);
谢谢所有
................. .................................................. .................................................. .................................................. ..
我的尝试:
i不知道非常
........................................ .................................................. .................................................. .................................................. .................................................. ............
Hi every body
I need to know how I can pass an char array's elements such as
argv[0] = "./run_single_zone"
argv[1] = "data_pub/my_net.xml"
argv[2] = "data_pub/zone.xml"
argv[3] = "my_output.xml"
argv[4] = "[z <= 10]"
to the function which it take an integer and array, my function is
run_single_zone(argc, argv[]);
thanks all
.........................................................................................................................................................................
What I have tried:
i don't know very much
............................................................................................................................................................................................................................................................
推荐答案
int main (int argc, char* argv[])
从那里你可以知道 run_single_zone
的签名应该是这样的:
From there you can learn that run_single_zone
's signature should be something like this:
run_single_zone(int argc, char* argv[]);
(总是很好看的您正在使用的语言的文档...就像关于点的章节一样ers和数组)
(It is always good to read the documentation of a language you are using...like the chapters about pointers and arrays)
这篇关于将char数组参数传递给function的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!