How do you Merge a list of numbers in two files and input them in a third file witch has them ordered from smallest to largest.. I haven't learned about vectors in my class yet and this is chapter six in my c++ book (which I read) and no vectors included. Is there another way to do this without using a vector?
Open input files. (A & B)
Open output file. (C)
read in number A (a)
read in number B (b)
while ( there are numbers in file A and file B )
{
if ( a > b )
write b to C
read number in from B
else
write a to C
read number in from A
}
read in numbers from whichever file (A or B) which still has numbers in it.
write them out to C.