So I have an object and I want the object to be able to use in 2 different methods. Is it possible? If not, is there any work arounds for this.
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.
Of course. Objects live in dynamic memory and are pointed to by pointers. So long as you have a reference (the pointer) to an object you can access it from wherever you want.
After this call, and where theReference is in scope, you will have access to the object.