+ 2

Why the pointer points to the object. What is the point of doing this

MyClass obj; MyClass *ptr = &obj; //why we did that ptr->myPrint();

1st Jun 2020, 3:46 AM
Abdallah Nagy
Abdallah Nagy - avatar
4 Answers
1st Jun 2020, 3:52 AM
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚ - avatar
+ 1
bluesea ya thats a good point😅
1st Jun 2020, 4:27 AM
Abdallah Nagy
Abdallah Nagy - avatar
0
Thanks, that helped me:)
1st Jun 2020, 4:24 AM
Abdallah Nagy
Abdallah Nagy - avatar
- 3
c++
1st Jun 2020, 8:27 AM
Sonu Sonu Kaushyap
Sonu Sonu Kaushyap - avatar