C++ Abstract base classes and pure virtual functions [7]

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

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

  • @bena.7594
    @bena.7594 28 วันที่ผ่านมา

    watching multiple of your videos in one sitting means hearing Foo, Rectangles, and squares a bunch. Love the videos, thank you!

  • @brotherkingbig981
    @brotherkingbig981 9 หลายเดือนก่อน +10

    Thank for your teaching. I think your teaching is better our professor

  • @Towhid-ze3rw
    @Towhid-ze3rw 6 หลายเดือนก่อน +1

    Now this concept is my academic weapon for the OOP theory exam. Loved it

  • @brotherpeter00
    @brotherpeter00 15 วันที่ผ่านมา +1

    We should be aware that there are serious performance penalties with using virtual functions and inheritance in C++. For example, a virtual function can be 20 times slower than an inline function. The rule is to never use a feature in c plus plus that you do not understand the implementation of fully.

  • @jayeshpatil8497
    @jayeshpatil8497 หลายเดือนก่อน +1

    great explaination !!

  • @guillaumelacroix4436
    @guillaumelacroix4436 7 หลายเดือนก่อน +1

    thank you so much for this explanation of pure virtual functions!

  • @EarlySocket
    @EarlySocket 9 หลายเดือนก่อน +2

    thanks ,I found it an useful explaining simple video

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

    for the Bar class, would you not need to add keyword 'override' to add the implementation of the print() function?

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

      It's a good idea to @override it, but not necessary. It would be better.

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

    excellent videos, thanks so much :)

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

    I wish you were my cs professor.

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

    Sometimes, bacon and eggs is just foo. 🙃Sometimes, its very tasty.
    Nice class names!

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

    Love your content hank, is there anyway you could use AI to show examples where it makes mistakes or why it's important to utilise it's advantages

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

      Thanks tons for the comment.
      I am planning to do some more stuff with A.I. in the future, but haven't been able to get to it yet. It's on the stack of stuff though.
      In the meantime, I do have an A.I. play list I used for my classes at CSUEB. You can find some answers to your questions in those videos, at least implicitly.

  • @lg7t
    @lg7t 5 หลายเดือนก่อน +1

    so professor is this is the last oop video or there is a future playlist ? and thank you very much for these videos .

    • @ProfessorHankStalica
      @ProfessorHankStalica  5 หลายเดือนก่อน +1

      There's a whole play list. See the video description for the link.

  • @azadalishah2966
    @azadalishah2966 11 วันที่ผ่านมา

    🤔 When the derived class has to implement the abstract class’s pure virtual functions, what’s the point of having base class?

    • @ProfessorHankStalica
      @ProfessorHankStalica  10 วันที่ผ่านมา

      To ensure that all derived classes have a similar interface.

  • @alexandruteodor3585
    @alexandruteodor3585 ปีที่แล้ว

    Hi! I don't understand why you made the print function virtual in the derived classes.

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

      You don't have to do so. I do so out of habit to remind me that it is a virtual function in case I want to use the class as a base class for other classes. Basically as a form of documentation. You absolutely don't have to though.

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

    Hmm never seen virtual functions and that const before

    • @velvethamster9809
      @velvethamster9809 8 หลายเดือนก่อน +1

      virtual keyword in a function within class means, that function can be overridden by its derived classes.
      const keyword after the function parameter within a class means the function can not modify its class members.

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

      @@velvethamster9809 what

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

      @@hlubradio2318 ?