I am writing a program that will call the unix execv program based on some of the command line arguments passed to the program, so basically I need to make an argv[] for the execv call out of the argv[] that is passed to the program. Here is how I'm doing this
When I compile this with both gcc and borland on my windows platform, this section of code works perfectly fine, however, when compiling using gcc on my schools unix computer, this program crashes after the first "entered" is printed with a segmentation fault. Does anyone know what the problem is here and how to fix it?Code:char **programArguments; for(j = 0, i = 4; i < argc; i++, j++) { printf("Entered\n"); programArguments[j]= argv[i]; printf("Exited\n"); }