Hi Srinivasan,
Ok I am assuming that you are referring to K = 0 after i = new int[10];
After the line i = new int[10], the value of K is 6. if you remove k =0, The i[K] in
for(int j = 1000; j < 1010; j++)
{
i[k] = j;
k++; //Line in question.
}
will start with i[6], the for loop is performed 9 times, which will cause k value or i[k] go upto i[14]. Here is the problem. i is defined only as i[10], hope you got the point now!
Thanx
Vidya
[This message has been edited by Vidya Selvaraj (edited December 04, 2000).]