Question: ```
int main(int argc, char* argv[]){

    // checked for right number of arguments

    // reading pack name
    char* filename[MAX_STR_LEN];
    strcpy(*filename, argv[1]);  // seg fault here
}

```

Answer: 
```
char* filename[MAX_STR_LEN];

```

That declares an array of pointers, and doesn't initialise them to point to anything. Dereferencing them gives undefined behaviour; if you're lucky, a segmentation fault.

You probably meant to declare an array of characters to contain the string:

```
char filename[MAX_STR_LEN];
strcpy(filename, argv[1]);

```

Now you just need to make sure the array is large enough; or stop mucking around with low-level C artifacts and use `std::string` instead.
It should be

```
char filename[MAX_STR_LEN];
.
.
strcpy(filename, argv[1]);

```

or better still

```
snprintf(filename, sizeof(filename), "%s", argv[1]);

```