Does your data file end with a newline? That is, after typing "12", do you hit the enter key?
When using eof( ) to test for end of data, that's usually a crucial requirement of the data file.
Try controlling your loop thusly:
while( Entrada >> num1 >> num2 )
{
//do the processing
}
If the read action is successful, you'll enter the loop body. However, in this form, you
must have an even number of data elements in the file.
Reputation Points: 1268
Solved Threads: 228
Posting Virtuoso
Offline 1,895 posts
since Aug 2007