Pointers to Derived Classes in C++ | C++ Tutorials for Beginners #55

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 575

  • @CodeWithHarry
    @CodeWithHarry  4 роки тому +84

    Instagram pe NASA wala video kis kisne dekha? Dekh lena - instagram.com/codewithharry
    Aur saare C++ videos ka source code website pe daal diya hai! - codewithharry.com/videos/cpp-tutorials-in-hindi-1

    • @DivyanshuLohani
      @DivyanshuLohani 4 роки тому +1

      Harry Bhai java pe tutorial series banao please
      Btw
      Love your videos

    • @akashgoyal7279
      @akashgoyal7279 4 роки тому +2

      Harry bhai php and asp.net pe videos bnao ki konsa jyda helpful h .

    • @lilagadtaula7597
      @lilagadtaula7597 4 роки тому

      #codewithharry brother i have a problem related python programming
      mystr= "i live in urlabari"
      print(mystr.replace("i", "we"))
      in this code it changes all "i" in the string so how can we change only a specific word or character in python

    • @ashutosh-pandit
      @ashutosh-pandit 4 роки тому

      @@lilagadtaula7597 If you want to change :-
      1). specific character then use indexing
      2). Specific word then use slicing (i.e.- index range)

    • @devilfrost9491
      @devilfrost9491 4 роки тому +1

      So Glad your back with C++ 😊😊👍🏻

  • @Aiyaansh
    @Aiyaansh 3 роки тому +76

    I just watched this video for 3 times and got complete clarity about pointer to derived class as well as base class, default behaviour. Next video of virtual was so simple because of this video.

    • @sanukumar6811
      @sanukumar6811 3 роки тому +1

      bro can you please explain me the code line number 24. why we need to point base class pointer to derived class object? without that it is not running.

    • @miniart8670
      @miniart8670 2 роки тому

      @@sanukumar6811 bro agr aapko smj aaya tha toh please muje bta do

    • @RohitBhamu08
      @RohitBhamu08 9 місяців тому

      @@sanukumar6811 because if you don't do that the pointer won't be pointing to anything

  • @rishabhthakur12327
    @rishabhthakur12327 4 роки тому +11

    aap bahut hardworking person ho. i like your work👍👍👍

  • @Everything-uo8vt
    @Everything-uo8vt 4 роки тому +385

    2 minutes of silence for those college teacher's who thinks they are the only source of students to learn programming

    • @biker_karanpal
      @biker_karanpal 3 роки тому +15

      Don't compare any UA-camr to teachers 👍

    • @biker_karanpal
      @biker_karanpal 3 роки тому +2

      @Imperfect 👍

    • @MAX_RITIK
      @MAX_RITIK 3 роки тому +1

      Hahaha

    • @criminalcoder6307
      @criminalcoder6307 3 роки тому +32

      Teachers are useless nowadays and to some extent colleges also...
      Exceptions are always there.

    • @oggy107
      @oggy107 3 роки тому +6

      they aren't even source...

  • @abrarahmad3897
    @abrarahmad3897 Рік тому +2

    5:36 In my opinion, no error would be raised since the derived class is already inheriting the base class. Thus, it may not be wrong to point a pointer object of the base class to the derived class, Ig.

  • @amanbhadauria2881
    @amanbhadauria2881 3 роки тому +7

    All the member of the base class are part of the derived class. However, the derived class can only access members that are public or protected.

  • @criminalcoder6307
    @criminalcoder6307 3 роки тому +6

    Easiest topic ever
    It's all about mindset and understanding..
    No need to watch again
    U explain it so nicely that I understood it on first go..

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

    congrats sir waiting for ur 5million from months ...finally its 5 ....u r really a great person in the world...the way u teach us that any cllg or any universities cant give us ......

  • @harshsri3450
    @harshsri3450 2 роки тому +4

    Harry bro, your videos are still helping people to educate themselves and clear their concepts in programming👍. You are really like a magician like how your videos are too much effective so that a person with zero coding knowledge and zero skills can start from scratch and become a pro in coding 🔥and can also tech their batchmates 😁

  • @rishabh6051
    @rishabh6051 4 роки тому +2

    you have cleared all my doubts about this chapter thanks for making this video

  • @aaravanand2325
    @aaravanand2325 Рік тому +6

    @codewithharry- What was the use of pointing base class pointer to derived class object .
    Neither it was able to change the value of derived class variable neither it was able to display the value of derived class variable
    Was it just used here so that we could understand the concepts ?
    If yes, please reply with a yes there are many comments asking for the same
    Thankyou

  • @theoptionalvlog1628
    @theoptionalvlog1628 3 роки тому +1

    I recommended it, watch this video minimum two time whole concept should be cleared 👍👍👍👍👍

  • @sunnychauhan702
    @sunnychauhan702 4 роки тому +1

    You are best teacher in the world sir, thankyou very much

  • @sabaqureshi4779
    @sabaqureshi4779 3 роки тому +1

    Pta ni kesay log 3 din mein sari videos dekh letay hain aur unko samajh b aa jata h...maine tou pichly 3 videos 3 baar dekhy hain aur yeh video 2 baar dekha h aur sahi se practice ki h tb ja kr yeh concept clear hua h mujhy....😞

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

    I have to watch it 4 times now I am clear about all the things happened in that program......
    recommended to watch it 2 times or more.....................

  • @Sherwaani
    @Sherwaani 4 роки тому +6

    I've watched it 3x. Just for enhance my knowledge again & again.

    • @heyya2968
      @heyya2968 3 роки тому

      3x playback speed nhi hoti yt me

    • @Sherwaani
      @Sherwaani 3 роки тому

      @@heyya2968 mean 3 times

    • @heyya2968
      @heyya2968 3 роки тому

      @@Sherwaani accha

    • @heyya2968
      @heyya2968 3 роки тому

      @@Sherwaani ha thoda complicate kardiya hai isne kum waqt me explain karne ke liye

    • @shifuji-7154
      @shifuji-7154 3 роки тому

      @@Sherwaani
      hey buddy , what does biding means here ??

  • @siddhanttiwari6367
    @siddhanttiwari6367 4 роки тому +5

    Thank you very much sir for that much hard work for us ,you are the best
    . I hope you will keep uploading videos on c++ until the course end.😊😊😊

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

    5:41 No because the datatypes are different pointer is made to store adress of baseclass objects

  • @anshulpatil7525
    @anshulpatil7525 4 місяці тому

    thank you harry sir for explaining the concept so well

  • @techustaad4845
    @techustaad4845 4 роки тому +6

    Bro I'm big fan of you. And watching you web development series. I want that please make ecommerce websites just using html & css. Thanks

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

    👍🏻Dobara dekhi video Harry bhai,
    Aur zyada smajh aayi .

  • @harshpratapsingh1638
    @harshpratapsingh1638 3 роки тому +1

    Pehle pointers sunke hi dimag phat jata tha lekin aap se padhne baad pointer banne laga thanks yrr is course ke liye🙏🙏

  • @gamerscell9975
    @gamerscell9975 3 роки тому +1

    video ko 2nd time watch krne ma full smjh agaya '
    \

  • @varungupta6119
    @varungupta6119 4 роки тому +4

    sir please make series on how to build logic for beginners using (Data Structure, Algorithms, Decision making statements.
    Selection statements.
    Iteration statements. Jump statements. etc)
    please reply sir

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

    Harry bhai Name of variable are choose in this video see to difficult to understand but concept clear thank you
    It is advice don't take serious...

  • @ronnie_10000
    @ronnie_10000 3 роки тому +2

    5:35 error will be there I think because maybe it will also inherit the pointer to base class.

  • @codesrhodes3757
    @codesrhodes3757 3 роки тому

    AAP sachme mahan ho harry bhaiya

  • @rishabhthakur12327
    @rishabhthakur12327 4 роки тому

    Harry bhai mujhe aapke sare tutorial best lgte hai please aap aise video bnate rhom hum aapko support krte hai.

  • @trilochanyannawar525
    @trilochanyannawar525 3 роки тому +1

    Kota Factory : Jeetu Bhai
    UA-cam : Harry Bhai.
    Yes. I said that.

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

    harry bhai these all are good thanks for giving complete c++ course

  • @vishalsaxena4869
    @vishalsaxena4869 4 роки тому +2

    you are just awesome Harry Bhai. I have learn many things from your channel. Video playlist is so awesome. and your way of explaining is mind blowing.
    one little request that please make tutorials on angular too.'
    thanks

  • @Ayush_.
    @Ayush_. 3 роки тому

    Base class ka pointer shirf base class ki Properties ko hi Access kar skta he ........
    jabki derived class ka pointer dono class ki properties ko access kar skta he .....par member function ke naam same hone par derived class ka pointer phlle derived class ke function ko run call krega

  • @shreyashkumarsahu5985
    @shreyashkumarsahu5985 11 місяців тому

    7:41 error logically will not be thrown but the concept which I am getting confused with is that baseclass is kind of inheritating derieved class which seems a bit strange as per my understanding

  • @kiranshinde03
    @kiranshinde03 3 роки тому

    7:31 program run karega 😁 harry Bhai ❤️

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

    11:29 most important line in this video

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

    i think at 7:37 program should not run because bhai int main me upr vale koi bhi function ko call nhi kiya gya shyd

  • @karanrawat1659
    @karanrawat1659 4 роки тому +10

    Sir one kind request , please try to visualize us by showing animation that how pointer is being pointed or allocation of memory ,etc.

  • @KshitizAgain
    @KshitizAgain 4 роки тому +4

    Love your Work Harry Bhai!❤️😅Waiting for you to reach 1M Milestone!

  • @ravinderchauhan9007
    @ravinderchauhan9007 4 роки тому +1

    hlo herry bhai yor are great bro thanks for lerning c++

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

    In start when he said to watch the video twice... I thought he is saying that for views and then when I actually didn't understand so i tried one more time and then it actually started to understand ❤

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

    Since from starting to the playlist ,Finally I shift from1.5X speed to Normal speed in this video.

  • @AyazKhan-kr6qv
    @AyazKhan-kr6qv 4 роки тому +1

    I watched 3 times and now 101 percent clear

  • @ashutosh2933
    @ashutosh2933 3 роки тому +2

    I think u r wrong harry bhai ... 8:32 You said " Isey kehete hai Late Binding " yaha early binding ho rahi hai
    15:40 u again said " ye hai run time polymorphism ", no its not, binding is static here and pointer type ko dekh kar , compiler function ko compile time me bind karega us type ke sath.... we can use virtual keyword to achieve late binding

  • @rishabhjain911
    @rishabhjain911 3 роки тому

    # I will definitely watch this video again

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

    5:35
    No

  • @mdarsad7694
    @mdarsad7694 2 роки тому

    i love the way of your teaching
    thank you

  • @mikey_0.
    @mikey_0. 4 роки тому +1

    Great teacher

  • @rishabhjain911
    @rishabhjain911 3 роки тому

    Thanks Harry Sir for this helpful video

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

    aaj maine ye video 2nd time dekhi aur is baar aur bhi ache se samjh aa gyi

  • @ChiragVaishnav-c4x
    @ChiragVaishnav-c4x Рік тому

    After watching poly times, finally completed understood the main concept of the video.

  • @engineerbhai7642
    @engineerbhai7642 4 роки тому

    You are great coder in you tube.

  • @arvindrawat247
    @arvindrawat247 2 роки тому

    5:40 no is my answer harry sir

  • @ambikadhakal6105
    @ambikadhakal6105 4 роки тому +24

    Harry, Please zoom the code please

  • @anirudhsinhrajput9238
    @anirudhsinhrajput9238 4 роки тому

    Harry bhai...your videos are awesome....plzz never stop making such amazing videos

  • @jinsishahcs7889
    @jinsishahcs7889 3 роки тому

    harry bhai you are a saviour

  • @prodevmahi4901
    @prodevmahi4901 3 роки тому

    really we need to see this video twice to understand properly

  • @mohitbalwani
    @mohitbalwani 4 роки тому

    East or west, harry is the best !

  • @royfamily9273
    @royfamily9273 2 роки тому

    Thanks Harry Bhaiya

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

    yes it will run

  • @rohitarora2319
    @rohitarora2319 2 роки тому

    Derived class ka object base class ke pointer ka use kr skta hai kyukii derived class usi ki child class hai isiliye child class bhi apni parent class ke pointer ka use kr skti hai

  • @silentknight2126
    @silentknight2126 2 роки тому

    I wish i could like these videos more than thousand times...🥺❤️🔥

  • @TheISP
    @TheISP 4 роки тому +5

    5:36 I think there will be an error, because Base Class does not contain all features of derived class, but derived class contains all features of base class
    11:30 doubt cleared, we can't access unique elements of derived class using base pointer.

  • @ChiragVaishnav-c4x
    @ChiragVaishnav-c4x Рік тому

    Thank You, Sir !

  • @vijaymala4846
    @vijaymala4846 4 роки тому +1

    Mast hai Bhai !!!

  • @satyamkarn3277
    @satyamkarn3277 2 роки тому

    Very Good video💖💖💖

  • @AyushKumar-tt4zh
    @AyushKumar-tt4zh 3 роки тому

    17:17
    yes it will show an error.

  • @sitadevisushan8074
    @sitadevisushan8074 4 роки тому +2

    Sir, Please Make A Full Playlist Of Java Programming For Absulate Beginners Plz Sir🙏🙏

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

    Amazing content sir...your videos are really heplful
    Please tell can we point to a base class using a derived class pointer...?

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

    Harry sir.
    You have not told us all about operator overloading.
    please give a detailed video on it.

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

    base class pointer can point to derived class object only if base class is inherited publicly to derived class. Remove Public and same will not happen.

  • @RADHEKRISHNA_437
    @RADHEKRISHNA_437 4 місяці тому

    Other's - click on subscribe button
    Harry sir - Ganta dabaye 🤣🤣

  • @sarthakvats1634
    @sarthakvats1634 3 роки тому

    5:35 Yes

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

    8:45

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

    Great explanation!!

  • @divy8999
    @divy8999 3 роки тому +1

    harry bhai please make videos for data structure and algorithm in C++.

  • @WHITEDEVIL-nu5og
    @WHITEDEVIL-nu5og 3 роки тому

    thankyou bro for the informative video and for your last instruction which is
    "watch the video again"
    thankyou keep going doinig good workk
    god bless you

  • @aryan7069_
    @aryan7069_ 3 роки тому

    5:35 yes

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

    10:49

  • @akashgoyal7279
    @akashgoyal7279 4 роки тому

    Harry bhai aapke videos bhot helpful hote hain. Please php and asp.net ke liye video bnao ki konsa jyda helpful h.

  • @princekangra5711
    @princekangra5711 2 роки тому

    You are best sir

  • @abrarahmad3897
    @abrarahmad3897 Рік тому +2

    Harry, just a question, if we cannot access the methods and members of the derived class with the pointer of the base class then what is the use of pointing that pointer of the base class to the object of the derived class? I mean, we could simply made a base class pointer and our code would work perfectly fine while occupying less memory space.

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

      same Qs of mine. What's the use of pointing to derived class then?

  • @Aiyaansh
    @Aiyaansh 3 роки тому

    5:40 Yes it will throw an erroy

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

    5:48 yes it will throw error

  • @gautam4696
    @gautam4696 3 роки тому

    easy thanks to harry sir.

  • @copyrightfreegameplays7731
    @copyrightfreegameplays7731 4 місяці тому

    7:35 yes

  • @thearyan_bgmi3400
    @thearyan_bgmi3400 19 днів тому

    Video starts at 3:00

  • @pratyushkurhe1577
    @pratyushkurhe1577 2 роки тому

    5:35 Yes I think it should give error.

  • @deepakchand5893
    @deepakchand5893 4 роки тому

    Love u bhai my inspiration

  • @rishabhjain911
    @rishabhjain911 3 роки тому

    I hope this gonna work at 7:30 because there is no syntax error , no object creation error so In my opinion it is gonna work

  • @nkbanerjee2549
    @nkbanerjee2549 2 роки тому

    after watching for 2nd time this video is completely understandable now

  • @growth.n.grinss
    @growth.n.grinss Рік тому

    5:38 yes i think

  • @AyanKhan-zh4it
    @AyanKhan-zh4it 3 роки тому

    I'm stuck on this video man!!! whenever i watch it, at the end Harry bro says it to watch it again😂😂 so i can't proceed to the next video. XD

  • @lalpreet2125
    @lalpreet2125 2 роки тому

    5.41 yes

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

    No It Wont Throw Error Because It Is Inherited from Base Class Both Pointers Are Interchangable According to me~

  • @ssppaannddaannbbaanniikk1934
    @ssppaannddaannbbaanniikk1934 3 роки тому

    7:30
    Compiler Will Not Throw Any Error

  • @arjunmaindarkar106
    @arjunmaindarkar106 4 роки тому

    Harry bhaiyya big fan❤

  • @programmingfacts1385
    @programmingfacts1385 3 роки тому

    Nice explanation

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

    Bhaiya operator overloading bhi krvado

  • @abhishekdhok5245
    @abhishekdhok5245 4 роки тому +3

    5:44
    Na

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

    mujhe ek baar mey hi samaj agaya