$ ./Main a
int main(int argc, char * argv[]) {
int i;
for(i=1;i<argc;i++){
if(argv[i] == NULL){ //This line does not work!
argv[i] = "Null";
}
}
theMenu(argv[1], argv[2], argv[3], argv[4]);
return (EXIT_SUCCESS);}
In theMenu function,when I called strcmp(argv[2],argv[3]); I will have segmentation fault :((
How can I make argv[x] = "Null" when user did not enter the parameter at x?