well remember when you have an array of 100 items, the last item is in the 99th spot so on that subject:
Code:#define NUMPACKETS 100 double arrivalTimeArray[NUMPACKETS]; for(int i=0; i<NUMPACKETS; i++) { // its not <= because it doesnt go up to 100 next = expDistArrival(); arrivalTimeArray[i] = next + current; current = arrivalTimeArray[i]; } // double test = arrivalTimeArray[100]; there is no 100th spot