I have c++ homework due tomorrow and need help.. i tried learning online but no help.. if anyone can help , please do . basically i have to write the class and functions for the main function.. and idk where to start. i paid attention but still very confusing.
1. Complete the program. Sort the cards in order least to greatest
no i don't have a class declaration.. my professor just told me to write the header files and class for the main program.. and I'm confused as how to start it
Well, from what I can see, it looks like there is only one class used here - "cards".
What sort of member variables does it look like it has? What sort of functions does it look like it has? are "sort_cards" and "print_cards" member functions or just functions that take a "cards" object?
If you want to have a vector of integers, you can use vector<int>.
If you want a vector of strings, you can use vector<string>
There's a bit about templates that I'd have to talk about to really explain it, but a vector can hold any class/item (as long as it is instantiable). But you have to tell it what it is holding by putting the type (class name) inside the '<>'.