linked list in c/c++
<p>I am going to multiply two polynomial that user must enter.</p>

<p>in the first step (getting info from user) I got this error:</p>

<pre><code>Unhandled exception at 0x00a315cb in linked polinomials.exe:
  0xC0000005: Access violation writing location 0x00000000.
</code></pre>

<p>I got this error after that I want to enter an other element of polynomial.</p>

<pre><code>struct polynomial{

    float coef ;
    int exp ;
    polynomial *next ;
} *first, *second ,*result;
</code></pre>



<pre><code>first = new(polynomial);
   //init first
first -&gt;coef = 0;
first-&gt;exp = 0 ;
first-&gt;next = 0;
</code></pre>



<pre><code>while(ch != 'n')
{
    cin &gt;&gt; temp_c ;
    cin &gt;&gt; temp_e ;
    first-&gt;coef = temp_c;
    first-&gt;exp = temp_e;
    cout &lt;&lt; "Do you want to enter another ? (y or n) :" &lt;&lt; endl;
    ch = getch();
    first = first-&gt;next;
}
</code></pre>
