Having some trouble with an array.

I have a list of baseball teams and I'm trying to store all the names in an array. I have written code that successfully compiles but when I do something like .... std::cout << winnerList[15] << std::endl; .... it only displays Cleveland, instead of Cleveland Indians. I thought I set up the getline correctly to get the entire line as some teams obviously have three names like New York Mets. Help would be really appreciated, thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
void indexTeams()
{
    std::string winnerList[108];
    std::ifstream winners("worldserieswinners.txt");
    if(winners.is_open())
    {

        for(int i = 0; i < 108; i++)
        {
            getline(winners, winnerList[i], '\n');
            winners >> winnerList[i];
        }
    }
}
remove line 11 and replace it with:

std::cout << winnerList[i] << std::endl;
Topic archived. No new replies allowed.