answersLogoWhite

0

A bit copy of an object is an exact, bit-by-bit, copy of that object. The default copy constructor generated by the compiler makes a bit copy.

This is potentially a problem if the object contains pointers to other objects...

A bit copy of a pointer copies the pointer, but not its data. This means that you have two pointers pointing at the same object in memory. If you delete one of them, the other becomes invalid, and this can (usually does) cause corruption.

If an object contains a pointer, the object's copy constructor should provide for proper allocation and copying of any pointed to objects within that object.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine

Add your answer:

Earn +20 pts
Q: What is a bit copy?
Write your answer...
Submit
Still have questions?
magnify glass
imp