I've been learning about input from files, and I found this code snippet on stack exchange
int main(int argc, char * argv[])
{
std::fstream myfile("D:\\data.txt", std::ios_base::in);
float a;
while (myfile >> a)
{
printf("%f ", a);
}
getchar();
return 0;
}
Other places i've looked said to use a char counter, and when char == eof
thats when the loop stops.
What is while (myfile >> a)
doing?