Is there there a way to store class objects in an array or vector in c++?
I have a class I am writing to do some basic fraction math.
Fraction fraction_1(a,b);
Is there a way to store each of those so that I can then add, subtract, multiply all the fractions later in my program?
ideally I would like to be able to just do say List[2] + List[3] (which would use my overloaded operator to do fraction addition)?
I am completely stuck trying to figure out a good way to do this as I do not have much experience with vectors in c++.
Yes, you can define a vector and add your elements to it: