Not understanding why I'm getting an error

I keep getting " error: no match for 'operator>>' in 'weatherFile >> w' ". I don't understand why.. Thank you in ahead if you can help me.
1
2
3
4
5
6
7
8
9
10
11
  void uploadData(vector<weatherData> &w)
{
    ifstream weatherFile("finalc++.csv");
    if(weatherFile.bad())
    {
        cout << "Error trying to read the file." << endl;
        return;
    }
    weatherFile >> w;
}
you can't simply read the file and store it directly to the vector like that.
you need to use a while loop and a temporary
weatherData object, fill in the members, then add it to the
vector using push_back( name_of_temp_object )
Topic archived. No new replies allowed.