I have a vector v[] full of class objects called kajigger with private members _thing1 and _thing2.
How do I swap the entire class objects within the vector? So far I have only been able to swap member values. This is one of those things I know was recently explained to me but has slipped my memory in a moment of need, and I know it's not complicated.
Class Example{
private:
int _thing;
int _another;
};
That's code that allows you to create grouped "objects"
So later I can be like:
1 2 3 4 5 6 7
Example object;
int x;
object._thing + object._another = int x;
//in my case, I am making a vector(array) of the objects:
vector<Example> v;
Explaining the usefulness of objects is something I am not going to attempt to do because I am a total newb and wouldn't do it justice. All I know at the moment is that they're a huge, huge element of object oriented design and they make C++ awesome.