C++: Pointer to char array
<p>I can't cope with pointers. Could you have a look at my problem.</p>

<p>A function is as follows:</p>

<pre><code> char * string_to_char_array(string line, int size)
 {
    char *a = new char[size];
    &lt;..........&gt;
    return a;
 }
</code></pre>

<p>I call it and get this:</p>

<pre><code>string autor = "Wern";
char * a = string_to_char_array(autor, 20);
</code></pre>

<p>Then I can do this:</p>

<pre><code>char Autor[20];
for (int i = 0; i &lt; 20; i++)
{
    Autor[i] = a[i];
}
for (int i = 0; i &lt; 20; i++)
{
    cout &lt;&lt; Autor[i];
}
</code></pre>

<p>I suppose this clumsy but somehow I don't know how to make it easier. Will you be so kind as to give me a piece of advice?</p>
