File stream problem

Hello all,
so I'm struggling to understand what's wrong with my code. I'm using visual studio, and I'm trying to put a long file into an array. But for some reason it doesn't do what I want it to, and skips to the error message instead:

void openWordListFile()
{
ifstream fin;
fin.open("dictionaryList.txt");

string wordList[20];

if (fin.is_open())
{
for (int i = 0; i < 20; i++)
{
fin >> wordList[i];
cout << wordList[i];
}
}

else
{
cout << "File failed to open.\n";
}

fin.close();

return;
}

Any idea what's happening? Thanks!
Well the issue is that the file isn't opening. My first question to you is does the file dictionaryList.txt exist in the local directory or is it located in some other directory like the desktop?
Well, according to other forums, I tried inserting it in the project directory by right clicking the project in the solution panel and then "add existing item." But I don't really care where I'm getting it from, I just want it to work. And I'm not sure how to open it from my desktop, if that's what I should do.
Topic archived. No new replies allowed.