If I have an object ‘Hotel’ which has a few set properties and I pass it to another object which populates more of its properties and then releases it will the first class see these values?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, that will work. But the object isn’t passed by reference; rather, you’re passing a pointer to the object, which means the caller and the callee both have pointers to the same object; thus, if you use a mutator to modify the object’s properties, both the caller and the callee will see the changes.