clarification using strdup() or strcpy() : <p>i have a problem
this method works fine, it returns a struct with the right NaME value</p>

<pre><code>prodotti creaProdotto(char *name, float price, prodotti next){
    prodotti p = malloc(sizeof(prodotti));
    p-&gt;name = malloc(30 * sizeof(char));
    p-&gt;name = strdup( name);
    p-&gt;price = price;
    p-&gt;next = next;
    return p;
}
</code></pre>

<p>else this do not works,</p>

<pre><code>prodotti creaProdotto(char *name, float price, prodotti next){
    prodotti p = malloc(sizeof(prodotti));
    p-&gt;name = malloc(30 * sizeof(char));
    strcpy(p-&gt;name, name);
    p-&gt;price = price;
    p-&gt;next = next;
    return p;
}
</code></pre>

<p>the problem in the second is: name does not contains the right value,
please explain ne why.</p>
