Inputting code into arrays

I need helping inputting data into different arrays. The txt file I am using contains a line of dates with temperatures next to them. There are a total of 90 dates and temps.I am trying to separate the data into files so that they are separated by month(30 days per month). I started by trying to do something simple but now i just have no clue. this is what i have so far. any input would be greatly appreciated.


const int ARRAY_SIZE = 90;
int array_30 [ARRAY_SIZE];

ifstream fin;
fin.open("tempdata.txt");



if(!fin){
cout << "Error - file not found" << endl;
return 1;
}

for (int i = 0; i < ARRAY_SIZE; i++){
fin >> array_30[i];
}
I have figured out my mistake, but now i am still struggling on separating the data appropriately.


onst char ARRAY_SIZE = 90;
char array_30 [ARRAY_SIZE];

ifstream fin;
fin.open("tempdata.txt");


if(!fin){
cout << "Error - file not found" << endl;
return 1;
}
fin.ignore(63,'\n');

for (int i = 0; i < ARRAY_SIZE; i++){
fin >> array_30[i];
}

for(int j = 0; j < ARRAY_SIZE; j++){
cout << array_30[j] << " ";
}


cout << array_30
Topic archived. No new replies allowed.