Originally posted by shawn sandy:
Why when i for loop through a vector, I get the same result back throughout the iteration, instead of the unique values?
thanks
Based on the code you just posted showing how you build the list, you are probably getting the last name you added, right?
What's happening is that you are in fact using a
single golfer. Your vector contains as many references to that same golfer as the number of times you invoke add().
You need to add a
new golfer every time.