Parallel vectors are two or more vectors of the same length in which corresponding elements are logically related. For example, a vector of student ID numbers and a corresponding vector of student scores.

Since it is difficult to manage multiple vectors, programmers using them tend to make them into global variables.

To avoid parallel vectors, find a concept that describes a single instance of the related elements and make it into a class having member data corresponding to the separate vectors. Then, make a single vector of the new class type. For example, instead of having a vector for student ID numbers and a vector for student scores, create a new class that encapsulates the two into one class.