I intend to read several numbers into the array of X and then several others into the array of Z; however, it happens that the following codes can correctly read X but not Z. Only after I change the 'i' in the second loop to 'j' will both read correctly. This is the only 'for' loops in my function.
Code:for (int i=0; i<dimofX_model; ++i) { readfile>>temp.X[i]; } //read in the X variables; for (int i=0; i<dimofZ_model; ++i) { readfile>>temp.Z[i]; } //read in the Z variables