Pointer not assignable in C?
<p>I want to create an array of strings, so I first use:</p>

<pre><code>char** p = malloc(sizeof(char*) * count);  // count is the number of strings
</code></pre>

<p>But then trouble comes when I want to initialize those strings:</p>

<pre><code>for (int i = 0; i &lt; count; i++)
{
    char* s = malloc(size_of_each_string);
    *p + i = s;  // THIS STEP INDUCES ERROR

    while (*s++ = *input++);  // initialize by copy
}
</code></pre>

<p>So I'm really confused. *p+i seems to be pointer arithmetic which shifts to another pointer. Pointer assignment in general is allowed (point to the same object). So why does such assignment not allowed? And how could I get around this to accomplish this task?</p>

<p>The error message is: Expression is not assignable.</p>