How do i change the address of a New struct in a loop?!
- by Yasin
Hi guys,
i'm writing a simple code which is about polynomials using link lists in C#. the problem i have is that whenever it creates a new struct (node) in the for loop it gives it the same address as the previous node was given. so how do i fix it ? here is my struct :
struct poly { public int coef; public int pow; public poly* link;} ;
and here is the where the problem occurs:
for (; i < this.textBox1.Text.Length; i++)
{
q = new poly();
......
p->link = &q;
}
&q remains unchanged !