I have a class set up to take in an item name, weight, and cost. I want to be able to sort the output different ways. Bubble sort the weight, Selection Sort by name, and Insertion sort by cost. I have no idea where to go now and I could use some help with this.
So I'm assuming I need to do an array for this then?
Edit: I guess I should rephrase this. My confusion is whether or not I can implement those sorts into my current code or if it needs to be changed to be able to use it?
also I should note that I changed the class a little bit since OP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//Class to hold inventory variables/funcitons
class Inventory{
private:
public:
//Placing these here to see if method will work//
char itemName[15];
int Cost;
int Weight;
/////////////////////////////////////////////////
void getData();
void showData();
};