C++ Programming Tutorial 93 - Operator Overloading == and +

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 51

  • @walrexx_2370
    @walrexx_2370 4 года назад +78

    Explain better than most paid c++ course

  • @Unikv
    @Unikv 3 года назад +9

    Honestly your teaching skills are godlike, but i'd appreciate if you left a comment pinned after every video with the code, what compiler you used, and if it's possible, the common issues when using what you're teaching

  • @nikolaosploumis5973
    @nikolaosploumis5973 3 года назад +5

    Thank you! I was stuck on this chapter as my course tried to explain this simple function with a class with raw pointers which are pretty complicated for me still. Not anymore though thanks to you!
    Thanks!

  • @Byynx
    @Byynx 2 года назад

    The best explanation yet. The first explanation that made me understand. You're the only that explains from where it comes what is on the left of the operator and what is on nthe right clearly. Specialy the left one.

  • @Sloth740
    @Sloth740 Год назад

    This is incredibly helpful. Going through this stuff in my class right now and the text book and materials have been so confusing! Thanks!

  • @quanduong3390
    @quanduong3390 4 года назад +6

    You are absolutely the best. Its really easy to follow as a beginner to this concept. Thank you

  • @PLarry7787
    @PLarry7787 3 года назад +1

    This is a great explanation. Have an assignment due and couldnt wrap my head around it.

  • @coreylatham755
    @coreylatham755 3 года назад +2

    My CIS 235 teacher is horrible at best. If it was not for you videos, I would not be doing as well as I am in the class. Keep up the solid work.

  • @saladforbrains2335
    @saladforbrains2335 4 года назад +12

    hey man you are saving my ass with these videos. thank you.

  • @TheEpicFace007
    @TheEpicFace007 3 года назад +1

    I love using operator overloading in my struct. It’s so useful

  • @PunmasterSTP
    @PunmasterSTP 3 года назад +2

    Operator overloading? More like outstanding content overloading! Thanks again for such a wonderful tutorial series.

  • @ronaldocorrea8007
    @ronaldocorrea8007 5 лет назад +12

    That was the best explanation. You Rock! thanks

  • @thiranaramuditha4025
    @thiranaramuditha4025 3 года назад +3

    After I created a constructor, error occurs..
    It says...no matching function for call to position ()...
    Where is the wrong ?

  • @vinniciusrosa8284
    @vinniciusrosa8284 4 года назад +2

    THE BEST explanation ever. Thank you. Now I did understand.

  • @enjoyinglife9853
    @enjoyinglife9853 4 года назад +1

    Thank you! Best explanation I have ever seen on operator overloading!

  • @scullyy
    @scullyy Год назад +1

    I accidentally forgot to return the correct type for the + operator overload, but apparently c++ handled the conversion automatically.

  • @raiyanreza9764
    @raiyanreza9764 4 года назад +2

    so operator overloading only works for c++11?

  • @user-vs6oe8fl3m
    @user-vs6oe8fl3m Год назад

    Thank you Caleb you are truly like no one else.

  • @pmcate2
    @pmcate2 2 года назад

    @5:36 you say "This is going to take a position on the right", but we also want it to take a position on the left. Why are we not caring about the left?

  • @ares106
    @ares106 2 года назад +1

    Why would anyone want to overload operators??? Isn’t C++ already complicated enough?

  • @chadwickcodes6417
    @chadwickcodes6417 3 года назад +1

    That is really cool. You don't have something like that in Java!

  • @あああ-e8o3y
    @あああ-e8o3y 2 года назад

    分かりやすかったです!

  • @cameronsmith7972
    @cameronsmith7972 3 года назад +1

    For the "operator ==" could you not just do:
    bool operator == (Position pos)
    {
    return (pos.x == x && pos.y == y);
    }

  • @benedictespiritu1001
    @benedictespiritu1001 4 года назад +2

    Nice vid! I have a question tho, can an operator be overloaded to have its own functionality? For example, in discrete mathematics the functionality of the asterisk(*) or other operators has been changed quite a lot. a*b=a(a+b) something like that. So could this be done in operator overloading? I haven't tried it in code that's why I'm asking here hehe

  • @prehistoricalgorithm2219
    @prehistoricalgorithm2219 4 года назад +1

    How am i ment to know that i needed to do that with the == operator and nice video too

  • @armandometko670
    @armandometko670 2 года назад

    very helpfull video
    but why dont you use using namespace std before thw class instead of writting std::cout?

  • @kingsoonkit9234
    @kingsoonkit9234 3 года назад +2

    i dont understand what's this for

  • @johnjepko3247
    @johnjepko3247 3 года назад +1

    Came in clutch ty

  • @datt012
    @datt012 3 года назад +1

    what name's ide he is using ???

  • @louisvanhunsel1932
    @louisvanhunsel1932 10 месяцев назад

    you are the F'ing man Caleb

  • @martysh1226
    @martysh1226 3 года назад +1

    i think you should use structs for data classes like position
    classes are usually used more for complicated things like users

  • @nathanoosterhuis6232
    @nathanoosterhuis6232 3 года назад

    Operator overloading now I get it

  • @heisenberg4374
    @heisenberg4374 Год назад

    You rock man

  • @carolynli4270
    @carolynli4270 Год назад

    start 0:32

  • @this_is_my_handle2
    @this_is_my_handle2 Год назад

    Why tf you used an if statement for returning a bool value

  • @NeverDaudIt
    @NeverDaudIt 2 года назад

    thanks bro

  • @swagout7472
    @swagout7472 9 месяцев назад

    God bless you

  • @nielsSavantKing
    @nielsSavantKing 3 года назад

    But what has this to do with RAD studio ?? I don't get it

  • @Sader2
    @Sader2 Год назад

    why do you say you are looking to check:
    if(pos1 == pos2)
    but then above it compare:
    if(x==pos.x && y==pos.y)
    Aren't you then just checking if x=x and y=y instead of if x = y???
    @Caleb Curry

  • @kamranmehar387
    @kamranmehar387 4 года назад +1

    Owsom 😊😊😊😊

  • @SkSafowan
    @SkSafowan 3 года назад

    great

  • @akifkartal2967
    @akifkartal2967 5 лет назад +1

    first of all thank you for this video but when you wrote the class you wrote the member variables as public and altough this is not good for object orianted programming you didn't mension about this one so this is not good at least you could say something about OOP principles.

    • @krug3588
      @krug3588 5 лет назад +2

      😂😂😂😂

    • @cabreram.4734
      @cabreram.4734 5 лет назад +1

      🤦🏻‍♂️

    • @bingkysskiliwaax7941
      @bingkysskiliwaax7941 4 года назад +3

      Well hes teaching about overloading not some oop principles. You dont know how to teach so maybe just shut up?

  • @lucasvictor2488
    @lucasvictor2488 4 года назад +1

    Muito bom

  • @frameofreference4705
    @frameofreference4705 4 года назад +1

    👍👍👍