I am trying to create a vector of class objects, sort the vector using bubble sort and then eventually print the sorted vector in a table format with the area of the circle displayed next to the correct radius. I am having trouble with the bubble sort function. I am trying to call the function on vector circles but I get an error.
[Error] invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<Circle>'
I am not sure how to make this work. Any help would be appreciated.
bubbleSort is expecting int but you send it circles :+)
There are also problems with using the operators > and += with circle type. You need to tell the compiler how to do those things. What were you thinking there? You want to add / subtract circles ? Consider retrieving the appropriate value and then do comparisons.
Hey,
Thank you for responding.
I am trying to compare the radius value that I sent in for each of the circles.
So I have a vector of circle objects and to compare them I need to convert them to a vector of ints? Or retrieve the int value to compare? I am so lost. I know there has to be a better way to do this and I am just not finding it.