Am I missing something? I keep outputting "No file found!"
<pre><code>void getBookData(bookType books[], int&amp; noOfBooks)
{
    ifstream infile;
    string file = "bookData.txt";
    infile.open(file.c_str());
    if (infile.fail()) {
        cout &lt;&lt; "No file found!" &lt;&lt; endl;
        infile.clear();
    }
    while (true) {
        string line;
        getline(infile, line, '\r');
        if (infile.fail()) {
            break;  
        }
        cout &lt;&lt; "Line: " &lt;&lt; line &lt;&lt; endl;
    }
    infile.close();
}
</code></pre>

<p>I've tried putting the file in every location I can think of, but somehow it's not loading in. Or, more likely, I'm doing something else wrong. This isn't anything like what the end result of my code is supposed to be like, right now I'm just trying to read out my file line by line.</p>
