What I am trying to do is the following:
ReceiptBag zero("zero");
ReceiptBag one("one");
ReceiptBag bags[2];
bags = &zero;
(bags+1) = &one;
Of course that is not valid code.
My goal is to be able to reference the same zero or one object by using its variable name or by dereferencing the bags array. I don't think bags needs to be an array--I have gotten the impression there is someway to use a plain pointer to replicate the affect of an array, but I can't figure out the syntax for that either.
Initially I tried to do the following
ReceiptBag zero("zero");
ReceiptBag one("one");
ReceiptBag bags[] = {zero, one};
But this appears to use the auto copy constructor on the ReceiptBag objects. Therefore bags* references a different ReceiptBag object than zero.
I have tried some other things as well, but they all appear to be invalid syntax.
I'm pretty sure this is an easy thing to do, but google results in close but unrelated problems.