I'm having a ton of trouble reading the text from a file into an integer array, the file contains 3 lines of 1,000 integers from 0 to 1. The array is myArray[3][1000]. So far I've tried to use a stringstream to no avail and I've attempted to use a few other methods based on examples from the net but none of them seem to work, they tend to wind up reading all 0's. Please be gentle, I've only been working in C++ for 6 days now, and prior to that I hadn't programmed for about 7 years (and that was in assembly and VB).
Edit: myArray is global, this is just one of the functions within the program
Current attempt:
void readArray()
{
int amountRead = 0;
ifstream in("output.txt",ios::in);
while(in>>myArray[0][amountRead]&& amountRead < 1000)
{
amountRead++;
}
amountRead = 0;
while(in>>myArray[1][amountRead ]&& amountRead < 1000)
{
amountRead++;
}
amountRead = 0;
while(in>>myArray[2][amountRead ]&& amountRead < 1000)
{
amountRead++;
}
}