// namegame.cpp : Defines the entry point for the console application.
/* Program that reads from names files and writes
to name files in a Lastname, Firstname format.
James M Snook III 10/10/12*/
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
usingnamespace std;
int main ()
{
//variables
ifstream lnamein;
ifstream fnamein;
ofstream nameout;
string lastname;
string firstname;
string nameout;
string pause;
//Get input from files
lnamein.open ("lastname.dat"); // contains a last name
lnamein.getline ("lastname.dat", lastname);
fnamein.open ("firstname.data"); // contanins a first name
fnamein.getline ("firstname.dat", firstname);
nameout.open ("nameout.dat"); // will contain last name, firstname
//output to screen
cout << \n << lastname ;
cout << \n << firstname ;
nameout << lastname << ", " << firstname;
//close files and pause screen before exiting
lnamein.close();
fnamein.close();
nameout.close();
cin.get ();
return (0);
}