What is the point of reading parameters[0] from file if u are replacing it with pt[1] later. Maybe what u mean is pt1[0]=parameters[0]? What are u using pt1[] (and pt2[],ct[],i,j,k) for anyway? can you post the full code?