I have a simple pointer question that I cannot figure out for somereason: I want
ID: 3615852 • Letter: I
Question
I have a simple pointer question that I cannot figure out for somereason:I want to create a pointer that points to the same thing asanother pointer (trying to search a list using root and an indexingptr):
object* objPtr = new object();
object* objPtr2;
Now I was thinking that this was the way to do it:
objPtr2 = objPtr;
OR
objPtr2 = &objPtr;
OR
objPtr2 = *objPtr;
None of these attempts work.
Any advice?
I want to create a pointer that points to the same thing asanother pointer (trying to search a list using root and an indexingptr):
object* objPtr = new object();
object* objPtr2;
Now I was thinking that this was the way to do it:
objPtr2 = objPtr;
OR
objPtr2 = &objPtr;
OR
objPtr2 = *objPtr;
None of these attempts work.
Any advice?
Explanation / Answer
Dear...
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.