Hello everybody. I have to merge two sorted files. Algotrithm that i'm using is below, but it reads not all the numbers in the files, and stops, even the files contain the same number of elements. What is wrong, I can't understand. Thanks.
As soon as one of the files is empty, line 11 will be false and you will drop out of your loop. After your loop is finished, you need to find out which file is still active and dump the rest of the elements from that file.