I am having trouble inputting sample data into an array and am wondering what I need to do to correct this?
The input sample is like this: 3 7 9 3 8 2 10 11 4 14
This is the code I am using and is not working. The MAX_SIZE of the array is 10.
void readToArray(int intArray[], ifstream& inFile)
{
int i;
for(i = 0; i < MAX_SIZE; i++)
{
inFile >> intArray[i];
}
}
Thanks for the help!