CONSTRUCTOR IN INHERITANCE -45

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

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

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

    Thank you so much. I got the defination of inheritance for constructor completely.

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

    Can you please tell about access specifier in inherintance : public, private and protected ???

  • @shiwani5145
    @shiwani5145 5 лет назад

    Thats very easy to understand, without any distraction and all doubts have been cleared at every point👍

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

    What if we want to make the first value A's, can we do it? You said it is unnecessary but is it alright?

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

    Great efforts 👏 well explained..

  • @atata0215
    @atata0215 5 лет назад

    what about "using Basic class::Basic class"
    like that:
    struct B : A {
    using A::A;
    B(int a,int b) : A(a+b) {}
    };
    which benefit we have from explicit inherit?

  • @nandinisharma4691
    @nandinisharma4691 5 лет назад

    A Cool method of teaching...😎

  • @chamanali8861
    @chamanali8861 7 лет назад

    Sorry what is the syntax named as u added in "let's do some modifications here"

  • @muniprasad6113
    @muniprasad6113 6 лет назад

    can you explain about multipath inheritance

  • @pavankumaryeluri2576
    @pavankumaryeluri2576 7 лет назад

    I don't get y by changing for private to protected we got the answer in 45th video..?

  • @mujeebrehman7097
    @mujeebrehman7097 6 лет назад

    how to pass string ??

  • @tatiachelidze8789
    @tatiachelidze8789 6 лет назад

    In case of inheritance, is it necessary to initialize all the members of parent class in it's child class, or can we skip it. for example parent class A has protected member data_a, and child class B has a member data_b. In B's constructor are we allowed to write B(int b):data_b(b){}. or is it important to mention data_a as well? thank's in advance you're awesome

  • @hadiali5922
    @hadiali5922 5 лет назад

    I didn't understood the way you passed int c in B constructor
    And then :A(c) , i am completely confused with this part
    Can you please explain it?

  • @ad2894
    @ad2894 6 лет назад

    These videos are excellent, thanks!

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

    Easy understanding

  • @waytotechenglish557
    @waytotechenglish557 7 лет назад

    Hello this is class A is with cout

    • @cyborgdale
      @cyborgdale 7 лет назад

      SAI GANESH VUPPALA The endl() forces a new line and flushes the output stream, but there is only one output in this function and then the function terminates so everything in local scope is deleted by the default destuctor anyway. If there were more cout() calls in the function, using endl() would probably be a good idea. Nevertheless, it is harmless to include it and probably develops a good coding habit.

  • @hritikjaiswal8193
    @hritikjaiswal8193 7 лет назад

    I want to know more about protected, public and about private
    I want to know about the pointer .

    • @Codearchery
      @Codearchery  7 лет назад +1

      Hey Hritik , first thanks a lot for Watching my Videos
      I think I uploaded videos on all the topics you have mentioned.
      You Just Need to Search them on My Channel :-)

  • @abdhoom786
    @abdhoom786 7 лет назад

    Hey, I have one doubt, what's the actual meaning of this "B() : A()" what's the : doing there? is it some sort of an operator?

    • @cyborgdale
      @cyborgdale 7 лет назад +1

      M.A.K The single colon (:) in C++ denotes a "member initialization list" and is used for 1) calling the base class constructor (as used here) and 2) for initializating member variables BEFORE the body executes. When used to initialize member variables of a class or structure, you will find it just before the opening brace, often on it's own line (but not required) to make reading the code easier.
      In the case in this video, the default constructor of class A was called so the initialization was implied. Had we wanted some other constructor, we would have to tell the compiler which one to use.
      Initialization is different from assignment. When you initialize, the object will be created and assigned in one operation, just as a default constructor assigns a zero to the data members upon creation, except in this case you are telling it to give you something other than zero. Take the following code:
      Foo(int num)
      : bar(num) //additional members to be initialized will be separated by a comma
      {
      }
      which does the same thing as:
      Foo(int num)
      {
      bar = num;
      }
      except that the first case is initialization and the second case is assignment. Initialization saves some processing and is absolutely necessary for class members which are constants or references.
      Maybe this video author has a video on it already (I didn't check) or perhaps he should make one for us.

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

    Excellent

  • @sampritipatel8981
    @sampritipatel8981 6 лет назад

    If we keep data_A as private and declare and define a display function inside class A. Then will the program run ?

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

      Only accessible from own class.

  • @shreyansh_prasad
    @shreyansh_prasad 7 лет назад

    Great effort.. Keep it up 👍

  • @magicalmehendi1278
    @magicalmehendi1278 4 года назад

    Best explaination

  • @anishaa3298
    @anishaa3298 6 лет назад

    even the music here makes the learning more fun..

  • @fatamajannattisha68
    @fatamajannattisha68 5 лет назад

    it helps me a lot

  • @subahschannel2411
    @subahschannel2411 6 лет назад

    Thanks for the Vedioes

  • @smartmobcornerpromotion2968
    @smartmobcornerpromotion2968 7 лет назад +1

    superb

    • @Codearchery
      @Codearchery  7 лет назад

      Thanks SmartMobCorner
      Help this channel by sharing it with your friends
      Keep on watching and Keep on Learning Cool stuff :-)

  • @1100adg
    @1100adg 4 года назад

    Nice

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

    veryyyyyy niceeee

  • @karthickdon5631
    @karthickdon5631 7 лет назад

    output I cannot understand

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

    gud

  • @samiulislamdurjoy
    @samiulislamdurjoy 4 года назад

    G 17

  • @vu5700
    @vu5700 4 года назад

    This was cute

  • @rndmusr-pf5fd
    @rndmusr-pf5fd 3 года назад

    holy fuck c++ is one hell of a mess. At least compared to java.