well, it seems i am not very good with either. I am having to write a program to draw a bezier curve in a graphics area. i have the graphics area sorted, all the input boxes sorted and the correct variables assigned to each box. However the whole thing falls down when i reach the draw statement that is assigned to a button. After various atempts, this is the 'best'. No errors when compiling, no error messages while running, the program just crashes as soon as i press 'draw' as if the program is not leaving the 'do' loop. also, im not convinced that im getting the program to write the answers into the arrays correctly. it's probably a silly error, but if anyone can help i'll be very gratefull.

Code:int x[100], y[100]; int draw() { x[0]= x0; y[0]= y0; c=1; u=1/100; gap=u; do { b0=pow((1-u),3); b1=3*pow((1-u),2)*u; b2=3*(1-u)*pow(u,2); b3=pow(u,3); x[c]=((b0*w0*x0)+(b1*w1*x1)+(b2*w2*x2)+(b3*w3*x3))/((b0*w0)+(b1*w1)+(b2*w2)+(b3*w3)); y[c]=((b0*w0*y0)+(b1*w1*y1)+(b2*w2*y2)+(b3*w3*y3))/((b0*w0)+(b1*w1)+(b2*w2)+(b3*w3)); c+1; u=u+gap; } while (u<1); draw_bezier (x,y,100,RED); return 1; }