I was looking at the example sections in the examples of the Vector Class from the STL library, in particular, of the Map Class. The example given of a student name with an associated letter grade maybe achieved by creating a student object of a class say Student with properties "username" and "grade", and then creating another class which includes the an array of student objects.

How is storing the data more efficient by using the Map Class more as opposed to creating an object as specified?