I have a function
int executeCommand(char args[][TOKENSIZE]){
char *argv[] = {args[0], args[1]}; // This works
char *argv[] = {args}; // This doesn't
}
The args variable will not be of fixed length so I can't use the first line as it is. I don't want to use malloc or free due to some reasons. Is there any way of initializing this argv array from args without hard coding the number of entries.
argsvariable to the function so you know how many there are.