bithub,
Thanks for the reply!
Here's what I ran into when I did that: the first object (this) is now altered by the operation (which makes it a +=, instead of a + operator) say you have code like:
Code:
foo foo1; // say myints is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
foo foo2;// say myints is 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
foo1 + foo2; //stores 4, 6, 8, 10, 12, 14, 16, 18, 20, 22 in foo1's myints
EDIT:
Laserlight, ah, I see what you're saying now Sorry about the long posting. The bulk of this code isn't mine-- we're just filling in the functions, but thanks for the advice! I'll be sure to do that in my code
We're not allowed to use elementArray[i]... Believe me, I'd love to do that instead!
Can you elaborate a bit more on what you mean about the copy constructor?
Thanks!