Operator Overloading Using Friend Functions | C++ Tutorial

Поділитися
Вставка
  • Опубліковано 7 лют 2025
  • How to implement operator overloading using friend functions in C++. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

КОМЕНТАРІ • 19

  • @moomi1427
    @moomi1427 Рік тому +4

    Hands down the best channel out there.
    Thankyou!

  • @jeffnagy4778
    @jeffnagy4778 2 роки тому +7

    I have a much better understanding friend functions and their use in operator overloading. Thank you!

    • @PortfolioCourses
      @PortfolioCourses  2 роки тому +1

      You're welcome Jeff, I'm very glad to hear that it helped you! 🙂

  • @Ptr-NG
    @Ptr-NG Рік тому

    I am ex fortran lover, and wanna impress myself in messing with c++ :) ...
    Though overlwelmed given the amount of stuff to learn, your courses are clear... and for that, BIG thank you!

  • @satyarajrana5702
    @satyarajrana5702 2 місяці тому

    Awesome explanation! Thanks so much sir.

  • @dabgotra
    @dabgotra 8 місяців тому

    Thanks

  • @timauberer4314
    @timauberer4314 Рік тому +1

    Such a great tutorial! You saved the day!

    • @PortfolioCourses
      @PortfolioCourses  Рік тому +1

      You’re welcome, I’m glad it was helpful for you! :-)

  • @fbi873
    @fbi873 2 роки тому +1

    Amazing explanation 🌹
    Subscribed

  • @ValliNayagamChokkalingam
    @ValliNayagamChokkalingam Рік тому

    Thanks once again Professor! So this->count and using count directly are the same thing, right?

  • @BilalBerek-tl3tq
    @BilalBerek-tl3tq 2 роки тому +1

    great job sir

  • @Ptr-NG
    @Ptr-NG Рік тому

    The friend function can be any function? Where should it be defined? I mean, can it be a member (private or protected) of class A and friend of class B?

  • @jjfan4014
    @jjfan4014 Рік тому

    The friend function for + operator overloading has compiling error, error C2440: 'return': cannot convert from 'Counter' to 'Counter'. I have to modify it:
    Counter operator+(Counter c1, Counter c2)
    {
    Countera;
    a.inputValue = c1.inputValue + c2.inputValue;
    return a;
    }
    I used cpp file and header file.

  • @realj7513
    @realj7513 10 місяців тому

    hi what IDE do you use?

  • @BilalBerek-tl3tq
    @BilalBerek-tl3tq 2 роки тому +1

    i have subscribed