You need to allocate memory for rArrayand also initialize the external loop counter i.
Since the content argvis constant lines, you can simply copy pointers to them
rArray = new char*[argc+1];
for(int i=0; i <= argc; i++) {
rArray[i] = argv[i];
}
delete [] rArray;
, argv[argc] NULL. , (, i<=argc)
( minitech), :
rArray = new char*[argc+1];
for(int i=0; i < argc; i++) {
int len = strlen(argv[i]) + 1;
rArray[i] = new char[len];
strcpy(rArray[i], argv[i]);
}
rArray[argc] = NULL;
for(int i=0; i < argc; i++) {
delete [] rArray[i];
}
delete [] rArray;