I need to Prompt the user to input the name of the data file. Input the data from the file into an array of structs. Use Selection Sort to sort the data by player number. Print a labeled listing of the sorted data to the screen. I can do the selection sort i just cant get my array to pop up and show itself. It says the file was opened but nothing was there. Help would greatly be appreciated.:)
int main ()
{
cout<<"Driver Name: Chad Cundiff"<<endl;
cout<<"Navigator Name: Chad Cundiff"<<endl;
cout<<"Date: November 9, 2010"<<endl;
cout<<"Lab CRN: 10940"<<endl;
cout<<"This Program works with an array of structs."<<endl;
cout<<endl<<endl;
footballPlayers list [MAX_PLAYERS];
int roster;
char choice;
string filename; // name of the input file
ifstream inFile; //input file stream variable
cout << "Enter the name of the input file: " ;
cin >> filename;
inFile.open(filename.c_str () );
if (!inFile)
{
cout << "bummer file name \n\n";
system ("pause");
return 1;
}
The declaration of getOne() says it returns a footballPlayers struct, but the code returns 1 (which isn't
a footballPlayers struct instance). Not sure how that would even compile.
its not running at all but no errors are coming up, it says there is a linkage error i really just need to get the code right so my array will print, which i am not sure of.