I am a beginner in programming and I am trying to make a code that reads 2 numbers from a file and then displays it in the output window on turbo c++. My code only reads the fi
Try using infile>>x>>y inside the while loop condition like this
while(infile>>x>>y)
then use the cout statement in the loop.
The std::cout should be inside the while loop:
std::cout
while(!inFile.eof()){ inFile >> x >> y; cout << x << " " << y; }