Problems with getting info from text files c++
<p>I'm rather new to C++ and I've been having trouble getting input from a text file.</p>

<p>Relevant code:</p>

<pre><code>vector&lt;string&gt; nutrientName;
vector&lt;float&gt; nutrientAmount;
vector&lt;string&gt; nutrientUnits;
vector&lt;float&gt; nutrientCalories;

ifstream nutrientFile;
nutrientFile.open(nutrientFileName);
float newAmount = 0;
string newUnit;
float newCalories = 0;

while (!nutrientFile.eof())
{
    int place = 0;
    char nameArray [50];


   while(c != ';')
    {
        if (c != '\n')
            nameArray[place] = c;

        c = nutrientFile.get();
        place++;
    }

    string newName(nameArray, place);
    nutrientName.push_back(newName);

    nutrientFile &gt;&gt; newAmount;
    nutrientAmount.push_back(newAmount);

    nutrientFile &gt;&gt; newUnit;
    nutrientUnits.push_back(newUnit);

    nutrientFile &gt;&gt; newCalories;
    nutrientCalories.push_back(newCalories);

}

nutrientFile.close();
</code></pre>

<p>The input is a list of ingredients and some nutritional facts about them set up like this:</p>

<p>Ingredient1(1+ words); amountOfUnitsInServingSize(float) unitType(1 word) caloriesPerServing(float)
Ingredient2(1+ words); amountOfUnitsInServingSize(float) unitType(1 word) caloriesPerServing(float)</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>My problem is that when I try to bring stuff in from the file it gets stuck in either one of the while loops (if the inner one is commented out). When I throw debug code in, it indicates that it's not actually getting any input from the file.</p>

<p>Thank you in advance!</p>
