Is it possible to call private data member from operator overloading function even when it is not declared as friend function?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is it possible to call private data member from operator overloading function even when it is not declared as friend function??

6th Aug 2018, 1:32 PM
Shikhar gupta
Shikhar gupta - avatar
3 Answers
+ 2
just to give you hint, it should be accessible as your operator overloading will be member function and member function obviously can access private member
6th Aug 2018, 4:06 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
try your self creating code in playground and see the results... happy learning Shikhar gupta
6th Aug 2018, 4:04 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
thanks😊
7th Aug 2018, 1:48 PM
Shikhar gupta
Shikhar gupta - avatar