Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
Clear explanation. Is it always necessary to declare Test2 class as forward? Cannot we use same class i.e., Test1 and pass as argument, for instance, operator >(Test & lhs, Test & rhs)? Thanks.
Since operator function is not the member function of any class(but it is a friend function), here implicit objects as formal parameters is not possible. So explicit is mandatory. It's like a rule
Can someone clear my doubt.. Actually we are using friend function to decrease several member functions and also advantage of calling data members outside the class but here in this program we mentioned 2 member functions in class test2 and class test 1 and also friend function twice means whenever we define new classes we have to define friend function i.e here also we are invoking the functions there will be increase right? then what is the use
ramsai rao there is a slight difference between defining and declaring. If u understand that your doubt will be cleared. He has defined those function inside class not declared.
Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
Great explanation from great prof.
Great explanation sir💖💖💖thankYou
very good explanation . I really appreciate and will look forward for all your videos.
Clear cut Explanation 🤝🤝👌👌👌
love from Nepal. Thanks for this tutorial
Very good explanation sir!
Great sir fan ho gay ap kay..GOD BLESS U
very nice explanation really like your work sir keep it up.
wow sir you r great thankyou so much sit
Clear explanation. Is it always necessary to declare Test2 class as forward? Cannot we use same class i.e., Test1 and pass as argument, for instance, operator >(Test & lhs, Test & rhs)? Thanks.
He is using a binary output operator that's why
Nice 🎊
Thanks sir 😇
Thank you sir
Other than friend function also
How are we able to pass the object as an argument to operator function and not voilate the rule of private member ?
Bro can u explain this question little bit more clearly?
I have 1 doubt that in syntax we hv variables in bracket but here we took class names as variables...why???
because which object is coming from which class, that is why there is mention class name with object.
#include
using namespace std;
class kharat;
class ajay
{
private:
int a;
public:
void getdata()
{
couta;
}
friend void operator
thanks sir
Can't we call operator function by implicit object here, like in previous examples, so that operator function gets only one object T2 as argument??
Since operator function is not the member function of any class(but it is a friend function), here implicit objects
as formal parameters is not possible.
So explicit is mandatory.
It's like a rule
But how to overload
Can someone clear my doubt..
Actually we are using friend function to decrease several member functions and also advantage of calling data members outside the class but here in this program we mentioned 2 member functions in class test2 and class test 1 and also friend function twice means whenever we define new classes we have to define friend function i.e here also we are invoking the functions there will be increase right? then what is the use
ramsai rao there is a slight difference between defining and declaring. If u understand that your doubt will be cleared. He has defined those function inside class not declared.
@@shashankdixit92 it's the opposite. He has declared the friend function in the classes and defined it once outside.
Vamooooossss
Thank you so much sir
thanks sir
thanku sir