Virtual Destructor In C++

Sdílet
Vložit
  • čas přidán 19. 11. 2020
  • JOIN ME
    -----
    CZcams 🎬 / @cppnuts
    Patreon 🚀 / cppnuts
    COMPLETE PLAYLIST
    ------------
    C++ Tutorial For Beginners: • Introduction To C++
    STL (Standard Template Library): • STL In C++
    ThreadIng In C++: • Multithreading In C++
    Data Structures: • Data Structure
    Algorithms: • Binary Search
    Design Patterns: • Factory Design Pattern...
    Smart Pointers: • Smart Pointer In C++
    C++14: • Digit Separator In C++
    C++17: • std string_view in C++...
    C++ All Type Casts: • static_cast In C++
    INTERVIEW PLAYLIST
    ------------
    C++ Interview Q&A: • Structural Padding & P...
    C++ Interview Q&A For Experienced: • How delete[] Knows How...
    Linked List Interview Questions: • Find Kth Node From Bac...
    BST Interview Questions: • Search Element In Bina...
    Array Interview Questions: • Reverse An Array
    String Interview Questions: • Check String Is Palind...
    Bit Manipulation Questions: • Find Set Bit In Intege...
    Binary Tree Interview Question: • Invert Binary Tree
    Sorting Algorithms: • Bubble Sort
    C++ MCQ: • Video
    C MCQ: • What printf returns af...
    C Interview Questions: • Designated Initializat...
    QUICK SHORT VIDEOS
    -------------
    C++ Short : • C++ Short Videos
    C Short : • Shorts C Programming MCQ
    In thiis video we will learn about virtual destructor in C++.
    NOTES:
    1. If we delete child class object through a pointer of parent class then it is undefined behaviour,
    if parent class doesn't have virtual destructor.
    2. If we fail to declare destructor as virtual in parent class then we endup having memory leak.
    #cpp #virtualfunction #programming #interviewquestions #softwareengineering #computerscience

Komentáře • 50

  • @jonnywright8155
    @jonnywright8155 Před 3 lety +5

    Hey man! Glad 2 see you making videos again. All the best bro! - Jon

  • @byroxkdk7056
    @byroxkdk7056 Před 3 lety +3

    your videos are a blessing man, keep it coming.
    And if possible make a video on "file handling".
    Cheers mate.

  • @ShailJava
    @ShailJava Před 2 lety

    Thanks for posing such videos. Really helpful. Please make more if possible on different topics.

  • @fardeen2158
    @fardeen2158 Před 3 lety +1

    Thankyou so much can u please cover these topics 1.Pointers 2.Link list 3. Stack & Queue 4.Graph.5.Tre please

  • @mockingbird3809
    @mockingbird3809 Před 3 lety +3

    Hi, Can you please cover std::istream, std::ostream, std::stringstream(ostringstream, istringstream), and std::istream_iterator topics which are related to streams? That would be great :)

  • @vedikvichar2813
    @vedikvichar2813 Před 2 lety

    Hi Rupesh,
    I want to prepare for interviews as an experienced on c++ and vc++ as well. Could you please help me on that.

  • @behindthescene4406
    @behindthescene4406 Před 3 lety

    I am beginer doing a lot of mistakes many times code doesn't even compile but still o don't give up...sometimes Google also betrayed for finding results , but still going 😎 thanks man your such amazing videos 😀

  • @wasimakram5371
    @wasimakram5371 Před 3 lety

    You are always amazing ❤️

  • @mayurpatil6991
    @mayurpatil6991 Před 2 lety

    where is that video of virtual pointer and virtual table in c++, i can not found ?

  • @marativamshikumar3489
    @marativamshikumar3489 Před 3 lety +2

    Hi Rupesh, one ☝️ kind request. Please make a video on vtable, vpointer and virtual internals.

  • @kanishkjain2767
    @kanishkjain2767 Před 6 měsíci +1

    You still haven't posted the video for vptr and vtable
    Please post that
    I am having trouble understanding those concepts from another videos

  • @prishaphotography9063
    @prishaphotography9063 Před 3 lety +1

    Nice video

  • @dhirajbennadi7850
    @dhirajbennadi7850 Před 3 lety

    Is it safe to make the destructor of the base class as virtual? If there is a statement delete this in the destructor of the base class would it not cause an issue??

  • @sivaramakrishnachitithoti1428

    Thanks

  • @arunchoudhary7493
    @arunchoudhary7493 Před 3 lety

    You have cleared the concept thansks :), in the end of the video you mentioned about the virtual pointer and virtual table, Where is that video, you posted that video?

    • @CppNuts
      @CppNuts  Před 3 lety

      Not yet.

    • @arunchoudhary7493
      @arunchoudhary7493 Před 3 lety

      @@CppNuts is there a plan to create that video, if yes, when can i expect that.
      Thanks in advance.

    • @prabhakaranraja8346
      @prabhakaranraja8346 Před 2 lety

      @@CppNuts Is there any plan to release the virtual pointer and virtual table video ?

    • @CppNuts
      @CppNuts  Před 2 lety

      @@prabhakaranraja8346 Yes in few days..

  • @KNT_19
    @KNT_19 Před 3 lety

    Is virtual destructor also added to the vtable like other normal virtual functions?

  • @udayachandran8541
    @udayachandran8541 Před 2 lety

    where is the link for vptr and vtable?

  • @raghuj7097
    @raghuj7097 Před 3 lety +1

    Sir, pls share internals of virtual functions, vtables , vptrs

  • @mainaibatauga1515
    @mainaibatauga1515 Před 3 lety +2

    Code blocks use karte ho kya aap?

    • @CppNuts
      @CppNuts  Před 3 lety +2

      VS code is the editor.

  • @vasudevemmennavar6946
    @vasudevemmennavar6946 Před 3 lety

    thanks for this amazing video bro. Please make a video for vtable and vptrs.....

    • @CppNuts
      @CppNuts  Před 3 lety

      Ok coming soon

    • @ramakrishnam5455
      @ramakrishnam5455 Před 3 lety

      @@CppNuts please post vtable and vptr video

    • @CppNuts
      @CppNuts  Před 3 lety

      Sure, in few days i will start posting.

  • @181Ravikiran
    @181Ravikiran Před 3 lety

    Bro, please make more videos, Thanks

  • @akashmore5238
    @akashmore5238 Před rokem

    where is the video link for VTable and VPointer???

    • @CppNuts
      @CppNuts  Před rokem

      I switched from windows to mac and those commands stopped working in mac, somehow i need to record this video on windows machine, which is kind of problematic because i don’t have windows machine.

  • @madhuriagawane3071
    @madhuriagawane3071 Před 3 lety +1

    next video of vptr and vtable?

    • @CppNuts
      @CppNuts  Před 3 lety

      It's ready, need time to record it.
      May be in 2 to 3 days.

    • @udayachandran5036
      @udayachandran5036 Před 3 lety

      @@CppNuts Can u please ping me the link here?

  • @gauravgoel8519
    @gauravgoel8519 Před rokem

    in my pc compiler is giving size of d 4 instead of 8 can you tell reason
    #include
    using namespace std;
    class Base {
    public:
    Base() {
    cout

    • @CppNuts
      @CppNuts  Před rokem

      Your computer is using 32 bit processor ?

  • @user-tz9kn1nu3u
    @user-tz9kn1nu3u Před 3 lety

    why don't you just make a makefile which could compile and run code for you?
    That could save you unnecessary typing.

  • @harshitrathi3077
    @harshitrathi3077 Před 3 lety

    bro are u from india , can i have u r instagram handle?

    • @CppNuts
      @CppNuts  Před 3 lety +2

      I don't use instagram :)