This is the input file I must use names.txt-
Franklin Delano Roosevelt
Abraham Lincoln
William Henry Harrison
John Fitzgerald Kennedy
Rutherford Birchard Hayes
Thomas Jefferson
James Monroe
Thomas Woodrow Wilson
Warren Gamaliel Harding
John Quincy Adams
Franklin Pierce
Dwight David Eisenhower
Stephen Grover Cleveland
James Knox Polk
I must call the file in my main program and using c strings I have to organize them in a last name first format. For example for the first one I must put the name in the output file as Roosevelt, Franklin D. I must do it in this format for all of the names. This is what i have so far and I am stuck. I am having trouble in my function.
Code:
//-------------------------------------------------------------------------
// File----------- Names
// Programmer---
// Course--------- CSC115
// Project-------- Program #9
// Due------------ December 8, 2010
//
// This program takes the names of individuals kept in a seperate input file and
// puts them in the last name first format and puts them back in an output file.
//--------------------------------------------------------------------------
#include <iostream>
#include <fstream>
#include <cstring>
void reverseName(char inName[], char outName[]);
using namespace std;
int main ()
{
inputfile = names.txt
outputfile = newnames.txt
char inName;
char outName;
cout<< "Select Input File:";
cin>> inputfile;
cout<< endl;
cout<< "Select Output File:";
cin>> outputfile;
cout<< endl;
//-----------------------------
//Name Function
//-----------------------------
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
void reverseName(char inName[], char outName[]){
ifstreaminputfile;
char inName[100];
char reverseName;
char originalName;
n= pieceCount(name);
inputfile.open(names.txt);
inputfile.fail
inputfile.getline(line,0);
while(!inputfile.eof()){
return 0;
}