Question: [c++] Sort an Array of Structs In this assignment, you are to create an array of structs and sort the array. 1. create a struct
[c++] Sort an Array of Structs In this assignment, you are to create an array of structs and sort the array. 1. create a struct with (at least) 3 fields. (int, char, string) 2. create an array of structs 3. read data into the array of structs from an external file. (9-11 records of any data you make up) 4. print all of the fields in the array (line up the columns using setw) 5. sort the array (in ascending order) on 1 field of the struct 6. print all of the fields in the array 7. sort the array (in descending order) on another field of the struct 8. print all of the fields in the array Keep in mind that the fields of a struct all go together, and when you swap 1 field of a struct you need to swap ALL of the fields in the struct.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
