ok, i have a 3 dimensional array. the program gets names and scores and stores them into the array accordingly. after that i want to have the students sorted by score, first or last name. after sorting have it print to the screen. right now it's only taking in 2 students just to make it easier on me. sounding like a assignment yet? well it is, I'm not denying it. lol. I have no clue as to how i would sort the info. any help would be much apprieciated. oh, if there is a more efficient way to do this would anyone plz let me know? thx again. hope i'm being clear...
this is all it is:
#include <iostream>
using namespace std;
int main()
{
char cSort; //choice of name or score sort
char cName [2] [2] [15]; //student 1 is in set 1, and 2 in 2
//first name in row 1, last in row 2
int iScore [2]; //stores scores
cout << "STUDENT #1\n";
cout << "Please enter first name: ";
cin >> cName [0] [0];
cout << "Please enter lastname: ";
cin >> cName [0] [1];
cout << "Score: ";
cin >> iScore[0];
cout << "\n\nSTUDENT #2\n";
cout << "Please enter first name: ";
cin >> cName [1] [0];
cout << "Please enter lastname: ";
cin >> cName [1] [1];
cout << "Score: ";
cin >> iScore [1];
cout << "\n\nWould u like to...\nSort by [F]irst name, [L]ast name, or [s]core: ";
cin >> cSort;
/*
if (cSort == 'f' || 'F')
//sort by first name
//print info to screen
else if (cSort == 'l' || 'L')
//sort by last name
//print info to screen
else
//sort by score
//print info to screen
*/
return 0;
}