well, you may want to start with actually opening and closing the files... for example, your code just asks the user for the filename, and if it gets a valid one, does nothing with it. The only time it does anything useful is when they give you a bad filename.
as for the rest, I'd create two arrays - one for the first six numbers, and another for the second six. for the first six, it really doesn't matter what kind of sorting algorithm you use because there's only six of them, but for help with searching algorithms, a simple search will turn up a great wikipedia page: http://en.wikipedia.org/wiki/Sort_algorithm
std::string checkname(std::string filetype);
//now you actually have a valid filename
* now you read in from the file and put the main part of your program
* right here.
* this function asks the user for input using the standard console input, and
* it keeps going through an internal loop until the user gives up a name of a
* valid (existing) file. Note that this function checks only for files that
* exist and can be read from. It does not check to see if a file can be
* created with a certain filename.
std::string checkname(std::string filetype)
* clear the file flags, in case they entered a wrong input
* on the last iteration of the loop. If this is the first
* run of this loop, this line is just a waste of code.
* ask for and recieve a filename. Wether it's a valid file is
* open to scrutiny later on
std::cout<<"Enter the "<<filetype<<" file name: ";
* now we're testing to see wether or not it's a valid file.
* If the file doesn't exist, it's going to run the loop again.
* if the file does exist, it's going to exit the loop.
std::cout<<"File doesn't exist - try again\n";
* here we're closing the file that we just opened and we're returning
* the name of that file.