The following code is meant to take all floating numbers for calculation from the file "float.txt" The problem is the floating numbers has junk information between it.
example file:
23.5 aujsaN8.2<:::32
After the first floating point is gotten, the while loop never ends, the program no longer gets any information from the file. please help.
int main()
{
    float num;
    ifstream input("float.txt");
    input >> num;
    while (!(input.eof()))
    {
        input >> num;
    }
    input.close();
    return 0;
}
 
     
     
     
    