Partly for the learning experience and partly just for the awesomeness of the finished product, I'm starting work on a multi-system game emulator. I'm planning on including MAME, C64, NES, SNES, N64 (depending on hardware), and any other consoles I think to add. Eventually I'm going to be buying some low-spec hardware to run it on and coming up with some sort of case (may use a NES case if I go with a small-enough motherboard, that does induce limitations though).

Anyway, the point of this thread. Step 1 for me right now is writing a GUI program that will allow the user to select an emulator, and from there select a ROM from a list generated from a file containing a list of all available ROMs. It then writes a single command to a batch file which launches the selected emulator with the selected ROM (I already have that part pretty much figured out).

The next step is to figure out how to read the ROM names from the file (I'll worry about generating the file later) and use that to list the available options for the user. I'm thinking maybe a plain .txt file would be easiest - one ROM name per line, then the program reads each line and inserts them as strings into an array so that any one can be referenced by number later (and inserted into the batch file).

Partly due to my inexperience, I've started out working on this program by getting the most basic element working and adding things from there. Here's what I've done today:

Code:
#include <iostream>
#include <fstream>
#include <stdlib.h>

using namespace std;

void launcher();

string emuname;
string gamename;

int main()
{
    int gameno = 0;

    cout << "Hello.\n" "Enter a number to select a game.\n";
    while (true)
    {
    cout << "\n 1. Donkey Kong Country" "\n 2. Super Mario World" "\n 3. The Legend of Zelda: A Link To The Past" "\n enter 0 to quit\n";
    cin >> gameno;
    if (gameno == 1)
    {
        emuname = "zsnesw.exe";
        gamename = "\"Donkey Kong Country.zip\"";
        launcher();
    }
    else if (gameno == 2)
    {
        emuname = "zsnesw.exe";
        gamename = "\"Super Mario World.zip\"";
        launcher();
    }
    else if (gameno == 3)
    {
        emuname = "zsnesw.exe";
        gamename = "\"Zelda - A Link to the Past.zip\"";
        launcher();
    }
    else if (gameno ==0)
    break;

    else
    cout << "Invalid selection.  Choices are:";
    }
    return 0;
    }

void launcher ()
{
        ofstream myfile;
        myfile.open ("temp.bat", ios::in | ios::trunc);
        myfile << emuname << " " << gamename;
        myfile.close();
        system("temp.bat");
}
Would an approach like what I've described above work, or is there a better approach? More importantly, would that approach be useful when I'm ready to start building a GUI? I've never really done much with reading/writing to/from files before, so any tips are appreciated.