so I'm doing a test on chapter 6 of my c++ tutorial and one of the questions is this:
http://pastebin.com/amSCY7ja
output:
What's wrong with my answer (I know I should have used std::vector but I rushed the lesson on it because I just want to get out of this hellish chapter as soon as possible )?Write the following program: Create a struct that holds a student’s name and grade (on a scale of 0-100). Ask the user how many students they want to enter. Dynamically allocate an array to hold all of the students. Then prompt the user for each name and grade. Once the user has entered all the names and grades, sort the list by grade (highest first). Then print all the names and grades in sorted order.
http://pastebin.com/amSCY7ja
output:
How many students do you wish to enter?: 2
Shrek
50
Hitler
75
50 got a grade of 0
75 got a grade of 0