The program has to read in player records from the keyboard, which I believe I have done correctly. Then it must save the info into an array, then sort it in ascending order by userid and print it. I believe I am halfway-right about this. Could someone with more experience please help him/me out?
The player records read in as follows
600 Smith John 34 53 22
200 Jones Jim 22 44 56
300 Chappelle Dave 22 48 12
Here is the code I have
struct Player
{
int numOfRecords; //Stores the total number of records
char userid[10];
char last[10];
char first[10];
int ties;
int losses;
int wins;
printf ("Enter the number of records: \n");
scanf("%d", &numOfRecords);// stores total number of records
int x;
for (x = 0; x < numOfRecords; x++)
{
printf("Enter the record data:\n");
scanf("%s%s%s%d%d%d", userid, last, first, &wins, &losses, &ties);
}
}
edit by ishkabible: please use code tags when posting code. like so,
This post has been edited by ishkabible: 16 September 2011 - 07:44 PM

New Topic/Question
Reply



MultiQuote



|