【发布时间】:2012-06-27 06:08:08
【问题描述】:
我不完全确定如何在 C 中做到这一点:
char* curToken = strtok(string, ";");
//curToken = "ls -l" we will say
//I need a array of strings containing "ls", "-l", and NULL for execvp()
我该怎么做呢?
【问题讨论】:
-
如果要按空格分割,为什么要指定
;作为分隔符? -
例如:string = "ls -l; date; set +v"