copy array of pointers and print the copy : <p>I'm trying to copy a pointers of arrays and print the values from the copied array, but I got a Segmentation fault.</p>

<pre><code>void kosomo(char * test[10]) {
        int j=0;
        char * test2[10];
        while (test[j] != NULL) {
                test2[j]=&amp;test[j]; // test[j] is the string, so with &amp; it's the address
                j++;
        }

        printf("%d ",*test2[0]); // trying to do * in order to print the string
}


int main() {
        char * test[] = {"abc","def",NULL};

        kosomo(test);
}
</code></pre>
