I am new to C, so please let me know if you see something just obviously stupid on my part :)

What I'm trying to do
---------------------

I have a file that has newline separated string values that I I'm trying to read into my program so that I can use them to compare with other values. I thought the best way to store them would in in a multidimensional array. My code looks something like this:

```
char **data;
char *src_line;
int counter = 0; /* To keep track of how many items are in this array */
...
while(fgets(src_line,MAX_LINE_SIZE,fp_src_file) != NULL){
    int tmp = 0;
    while(src_line[tmp] != '\0'){
        if(src_line[tmp] == '\n'){
            src_line[tmp] = '\0';
        }
        tmp++;
    }
    strcpy(data[counter],src_line);
    counter++;
}

```

This segfaults during the strcpy. Most of the resources I've found online that deal with multidimensional arrays do so with constant values. I'm sure that this is probably not the best way to do this so..

My questions
------------

1. Is there a better way to accomplish what I'm trying to do?
2. What is the proper way to get an unknown number of items into a multi dimensional array. Should I even be doing this?

Thanks!