Operator Overloading using Friend in C++ | C++ Tutorial | Mr. Kishore

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

ความคิดเห็น • 31

  • @NareshIT
    @NareshIT  5 ปีที่แล้ว

    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

  • @Dida2080
    @Dida2080 7 ปีที่แล้ว +7

    Great explanation from great prof.

  • @junedhsiddiqui3288
    @junedhsiddiqui3288 3 ปีที่แล้ว +1

    Great explanation sir💖💖💖thankYou

  • @sajaliffco
    @sajaliffco 7 ปีที่แล้ว +2

    very good explanation . I really appreciate and will look forward for all your videos.

  • @chahatvamdev4088
    @chahatvamdev4088 3 ปีที่แล้ว

    Clear cut Explanation 🤝🤝👌👌👌

  • @mohitsaud2071
    @mohitsaud2071 4 ปีที่แล้ว

    love from Nepal. Thanks for this tutorial

  • @deepmoulik-ck7nb
    @deepmoulik-ck7nb 2 ปีที่แล้ว

    Very good explanation sir!

  • @bismalmajeed2167
    @bismalmajeed2167 7 ปีที่แล้ว

    Great sir fan ho gay ap kay..GOD BLESS U

  • @yuvrajsharma2134
    @yuvrajsharma2134 4 ปีที่แล้ว

    very nice explanation really like your work sir keep it up.

  • @vinaychaurasiya7499
    @vinaychaurasiya7499 3 ปีที่แล้ว

    wow sir you r great thankyou so much sit

  • @kyo-p4l
    @kyo-p4l 6 ปีที่แล้ว +1

    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.

    • @SahilSingh-gf4ud
      @SahilSingh-gf4ud ปีที่แล้ว

      He is using a binary output operator that's why

  • @KaifAli-k8m
    @KaifAli-k8m 8 หลายเดือนก่อน

    Nice 🎊

  • @tarunsofat6890
    @tarunsofat6890 5 ปีที่แล้ว

    Thanks sir 😇

  • @nidhinhari8397
    @nidhinhari8397 5 ปีที่แล้ว

    Thank you sir

  • @sanjeevtyagi8819
    @sanjeevtyagi8819 4 ปีที่แล้ว +1

    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 ?

    • @molyoxide8358
      @molyoxide8358 4 ปีที่แล้ว

      Bro can u explain this question little bit more clearly?

  • @sanamS427
    @sanamS427 6 ปีที่แล้ว +1

    I have 1 doubt that in syntax we hv variables in bracket but here we took class names as variables...why???

    • @BharatKumar-qt6ey
      @BharatKumar-qt6ey 6 ปีที่แล้ว

      because which object is coming from which class, that is why there is mention class name with object.

  • @ajaykharat8689
    @ajaykharat8689 6 ปีที่แล้ว +2

    #include
    using namespace std;
    class kharat;
    class ajay
    {
    private:
    int a;
    public:
    void getdata()
    {
    couta;
    }
    friend void operator

  • @abhishekbcafrombmiit5470
    @abhishekbcafrombmiit5470 7 ปีที่แล้ว

    thanks sir

  • @mudasirwani9285
    @mudasirwani9285 3 ปีที่แล้ว

    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??

    • @PubgMobile-yr2tx
      @PubgMobile-yr2tx 2 ปีที่แล้ว +1

      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

  • @manalisamani6729
    @manalisamani6729 5 ปีที่แล้ว

    But how to overload

  • @ramsairao1467
    @ramsairao1467 7 ปีที่แล้ว +2

    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

    • @shashankdixit92
      @shashankdixit92 7 ปีที่แล้ว +1

      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.

    • @muhammedsahadbinabdulsamad2214
      @muhammedsahadbinabdulsamad2214 5 ปีที่แล้ว +4

      @@shashankdixit92 it's the opposite. He has declared the friend function in the classes and defined it once outside.

  • @YashAgarwal-xu5fd
    @YashAgarwal-xu5fd 2 ปีที่แล้ว

    Vamooooossss

  • @hope-jh7bv
    @hope-jh7bv 3 ปีที่แล้ว

    Thank you so much sir

  • @tuttejkumar6713
    @tuttejkumar6713 2 ปีที่แล้ว

    thanks sir

  • @by_me5
    @by_me5 หลายเดือนก่อน

    thanku sir