After writing the following program, it does not appear to pass arguments to the called application. While researching _spawnv and what it can do, _execvp was found as what appeared to be a suitable alternative. Does anyone see the problem in the source code and know what needs to be done to fix it?
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
int main(int argc, char** argv)
{
int index;
char** args;
args = (char**) malloc((argc + 1) * sizeof(char*));
args[0] = "boids.py";
for (index = 1; index < argc; index++)
{
args[index - 1] = argv[index];
}
args[argc] = NULL;
return _execvp("python", args);
}