Apr 5, 2013 at 6:52pm
Are you dynamically allocating memory for your barray
array?
If so, you will need to make sure that ba2's array is large enough to hold all the data in ba1's array before you start copying the data over.
If it's not, you will need to reallocate the array so that it's big enough.
Apr 5, 2013 at 10:11pm
BitArray ba2 = ba1;
calls the copy constructor, not the assignment operator.
Apr 5, 2013 at 10:57pm
To clarify:
1 2
|
MyClass inst2 = inst1; //copy ctor
inst2 = inst1; //operator=
|
Last edited on Apr 5, 2013 at 10:57pm