Quote:
Sorry, I can't explain it either. I thought I would be able to. I presumed another of the default functions the compiler supplies, namely the default copy constructor, was invisibly executing behind the scenes instead of the operator= function, but when I explicitly defined a copy constructor for the Apple class, it wasn't called either. I put display messages in the default constructor and the int constructor as well, and none of them displayed a message. So, it appears newApple is being created without a call to a constructor, which is impossible. One of the pros will have to weigh in on that, but I doubt any of them will wade through all these posts and end up here.
Below is the code with all the possible constructors defined: the default constructor, an int constructor, and the copy constructor. A copy constructor is called when you construct an object with another object: