So basically what I am trying to do is read in input from a class, and compare the two to sort them in a bubble sort algorithm. The problem I have run into is that I want to, within a bool function, compare ratings sent from an array of pointers pointing to the class. If the rating of the first is less than the second, it will return true and swap them. If the ratings are equal, then I want to sort by order of original input. I figured I can compare the location in memory of the pointers, but then realized that once swapped within the array, it will no longer be comparing them in order of original input, but in the order of the array of the pointers.
Here's the bool function (which I know the &m_rating is incorrect, as this is comparing the pointers location in memory, which is changed everytime it returns true (right?)
If you ever find your self comparing the actual memory addresses of pointers then you're probably doing something wrong. The simple answer here is to add an integer to your class that keeps track of what order they were entered in. Then compare that and swap them if you want to. There is no reason to over think this one.