I have been working on this program for a while now
I am a beginner so it is fairly hard and I have restarted many times if someone could please help it would be very much appreciated I am using visual studio 2015
Also the two external files mentioned are just long text documents filled with names
My main problem is I cannot get ifstream to work with the input files
This program tests the concepts of:
Looping
String Traversal
Arrays
Sorting
Searching
File Input/Output
Program Objective:
Write a program that creates an array of 5 full names using the list of names from 2 files; givenNames.txt and surNames.txt. The program should display the array of full names both unsorted and sorted.
Create the following functions: getName, sortNames, findName.
DON'T FORGET TO FINISH THE SDM AND HAND IT IN!
File Format Example
Program 5 P#v#.cpp P5v0.cpp
Record Layouts:
One name per line.
Special Calculations:
None.
Specific Processing:
Output Layout: (bold represents user input)
The Array
John Smith
Elizabeth Hornblatt
Fred Zanzibar
Murray Mandingo
Alice Mandice
Found John Smith at index 0.
The Sorted Array
Elizabeth Hornblatt
Alice Mandice
Murray Mandingo
John Smith
Fred Zanzibar
Found John Smith at index 3.
Other (Data, function names and conditions):
string getName(ifstream&)
void sortNames(string[], unsigned int)
unsigned int findName(string[], unsigned int, string)
Well, maybe you were almost there - instead of restarting yet again, perhaps you should post your best attempt at the code and someone should be able to point out any issues.