I'm reading the book 'C++ Without Fear 2nd Edu' and I'm a little confused on the subject of shallow copies.
The book says the problems can arise if you make a shallow copy of an object and something happens to the original, goes out of scope, is deleted, etc... I don't get it. When a simple copy is made doesn't the new object get a member to member COPY of the value? The way the book makes it sound is as if the new object isn't a copy at all, it's just another pointer or reference to the same old object. That's the only way I see that something happening to the original object would affect the new. What am I missing here? Thanks.
lewashby 56 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.