How to getline() from specific line in a file? C++
<p>I've looked around a bit and have found no definitive answer on how to read a specific line of text from a file in C++. I have a text file with over 100,000 English words, each on its own line. I can't use arrays because they obviously won't hold that much data, and vectors take too long to store every word. How can I achieve this?</p>

<p>P.S. I found no duplicates of this question regarding C++</p>

<pre><code>while (getline(words_file, word))
{
    my_vect.push_back(word);
}
</code></pre>

<p>EDIT:</p>

<p>A commenter below has helped me to realize that the only reason loading a file to a vector was taking so long was because I was debugging. Plainly running the .exe loads the file nearly instantaneously. Thanks for everyones help.</p>
