4

Unable to dynamically create an array of params for execv in C

view full story
linux-howto

http://www.linuxquestions.org – Hello everyone and thank you for looking at my little problem. I haven't programmed in C for a while, so I am trying to remember certain aspects of syntax. I have a program that will fork and exec other programs. Those programs will be specified on the command line as follows: ./main "prog1 arg arg ..." "prog2 arg arg ..." Here is the main snippet: int countChar(char* s, char c) { int cnt = 0; int len = strlen(s); for(int i = 0; i < len; i++) {if(s[i] == c) cnt++; } return cnt;} char** stringToArray(char* s, int *size) { char **array = (ch (HowTos)