Array of Objects Using Pointers in C++ | C++ Tutorials for Beginners #52

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

КОМЕНТАРІ •

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

    Ho sake to please is playlist ko share kar dena - ua-cam.com/play/PLu0W_9lII9agpFUAlPFe_VNSlXW5uE0YL.html
    Thanks for all the love and support. Kaisa chal raha hai ye course so far?

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

      Your Django course is great. I have suggested your channel to one of my friends who wants to start programming. ⌨

    • @Jatin-kumar
      @Jatin-kumar 4 роки тому +2

      Bhai course is going well 👍 and want to ask you to make a video on super Mario game with python

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

      Ek dam mast Bahi

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

      Hello sir java ka bhi complete course upload kijiye

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

      @@Jatin-kumar nice idea. I also want something like that

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

    yaar harry bhai tumhara bahut shukriya in sb videos k lye ! ik time pr programming naam sunkr hi dr lgta thha bt ab aapse yutube pr seekh kr ye sb hlwa lgta hai ,u r far better then my college faculty teachers jo k itni fees lekr bhi khuch nhi sikha paye !Allah aapko bahut khush rkhe u r my real mentor , mai ik bar apne real guru se milna chahta hun ! Tons of thanks

  • @MohsinKhan-sq6dq
    @MohsinKhan-sq6dq 3 роки тому +20

    3:25 Yo thara bhai Harry!
    itni classay baneyega,
    itni classay banayega
    k compiler bawla ho jayega

  • @pranjalck
    @pranjalck 3 роки тому +77

    Understanding Coding in desi style will have lot of fun,next time plzz use Kiraana 😂😂

  • @Sujan_Das14
    @Sujan_Das14 11 місяців тому +5

    at 16:28 we can do (ptr+i)->getData(p,q); and similarly the setData too , hope it helps

  • @techrohithd
    @techrohithd 4 роки тому +25

    Majedar Content..🔥🔥🔥

  • @musikasur1065
    @musikasur1065 4 роки тому +28

    Sir, you are really amazing! Thank you!

  • @solutionpoint6565
    @solutionpoint6565 4 роки тому +63

    Bro till now how many languages you have learnt
    👏👏For you
    Giving us a chance to learn alot of language

  • @abhishekkanojia2816
    @abhishekkanojia2816 3 роки тому +12

    17:50 creativity upto the level

  • @prateekshukla9017
    @prateekshukla9017 3 роки тому +92

    You could've used (ptr+i)->fn() inside the loops in order to avoid ptrTemp.

    • @mr.knight8967
      @mr.knight8967 3 роки тому +1

      Right

    • @iamFJ18
      @iamFJ18 3 роки тому +12

      Mera khayal se ptrTemp wala concept zyada asan hai

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

      Exactly I thought the same

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

      @@iamFJ18 aasan toh h but extra memory le rha h ptrTemp ko store krne mein

    • @sanyamgupta300
      @sanyamgupta300 2 роки тому +2

      can u pls write the code

  • @dv64bit
    @dv64bit 3 роки тому +29

    1:10 I will always prefer "Namaste Duniya" rather then "Hello World" ❤ 🇮🇳

  • @IDK-sk2yj
    @IDK-sk2yj 2 роки тому +5

    #include
    using namespace std;
    int count = 0;
    class Sum{
    float a;
    float b;
    public:
    void set_Value(float x, float y) {
    a = x;
    b = y;
    count++;
    cout

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

    harry bhai aap se zada humble insaan maine nahi dekha!!!

  • @generalaware123
    @generalaware123 2 роки тому +2

    Sab se achaa ninja techniques are given by Harry bai

  • @tanishkmerothiya7425
    @tanishkmerothiya7425 3 роки тому +5

    Awesome sir
    Your teaching style is awesome
    I m very thankful to you for providing us a great content for learning languages

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

    we can use statement p-=size b/w two for loop for p to again some at the start

  • @shaikhfaizan6233
    @shaikhfaizan6233 2 роки тому +7

    u r the most successsful coder .. u r having lots of knowledge .. allah give u more and more success in the future ..i want to become with u .. u r my role model .. lots of love haris bhai..for my side.

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

    Halvey se bhi zyada aasan kar diya hai harry bhai apne...thank you so much for this playlist

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

    Harry Sir, you explained the concept very well. Thank you!!!!

  • @dimpleverma1181
    @dimpleverma1181 2 роки тому +5

    Thanks sir for helping all students of india to become successful in there life. Hats off for such a great work.🎉🎉🎊🎊👏👏👍

  • @AshutoshKumar-fu6qe
    @AshutoshKumar-fu6qe 3 роки тому +5

    1.5K likes on every video. Your subscribers are maintaining consistency. Me too one of them.

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

    17:01 its called 3D explanation 👏👏👏harry bhai🙌😎

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

    buddy love the way you teach ♥♥♥♥

  • @vaishnavijain2015
    @vaishnavijain2015 3 роки тому +3

    Literally best teacher ❣️🌸

  • @jeetkishore7972
    @jeetkishore7972 2 роки тому +2

    16:35 we can use ptr+i in place of ptr++

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

      as i starts from 0 so you can write ptr+=1 instead of ptr++
      But use of ptr++ is just simple

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

      @@DevHrsh but wont we lose the ptr to 1st element. now this ptr will go till end and then how to bring it back to 1st???

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

      @@aishwaryaanand7870 no, we won't loose first element as loop is already executed for first loop

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

      @@aishwaryaanand7870 for bringing it back to first simply type ptr = ptr-3; after first loop block

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

      @@aishwaryaanand7870 #include
      using namespace std;
      class ShopItem
      {
      int id;
      float price;
      public:
      void setData(int a, float b){
      id = a;
      price = b;
      }
      void getData(void){
      cout

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

    I rewatch the last part after writing code and then I finally understand why did you use temporary address for 2nd loop ThankYou so Much Harry SIr

  • @Codesnaper_0
    @Codesnaper_0 2 роки тому +2

    Outstanding way of teaching ✌🏻✌🏻🙌🏻❤❤🔥🔥

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

      Why should we make array of pointers in this way,
      instead we can do
      complexno C(34, 12), D(89, 76);
      complexno *ptr2[] = {&C, &D};

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

    Visuals sahi 💯 tha. Great explanation 👏

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

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

    Shared this to my university's group
    Thank you so much Harry bhai!

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

    Thank you so much... Bhot ache se samajh aa gaya!

  • @skill-f
    @skill-f 2 місяці тому

    completed sir. Thank you sir...

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

    Harry bhai aap please sab video k end m 1 bar code ko start sa leka end tk show krdiya kro....bcz hum video m end m code ko copy pa note krta h for better revision in future .... toh hma upr ka code utarna k liya video k start m jana pdhta h.... isi bich kbi aap koi new chej add krdeta ho jo hnsa miss ho jati h......
    YOU'R WAY OF TEACHING IS RELLY NICE... I HAD NEVER SEEN ANY TEACHER WHO TEACH US BETTER THAN YOU... EVEN EQALLY TO YOU.....
    LOVE FROM JAMMU
    THANKS SOO MUCH TOH PROVIDE US FREE KNOWLEDGE IN VERYY VERYY GOOD WAY.....
    YOU TEACH US MANY COMPLICATED THINGS IN A VERY SIMPLE WAY... I REALLY SUPRISED HOW YOU DO THAT...
    THANKS AGAIN
    MOHIT...FROM JAMMU

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

    iss video jab 7:30 pe tha tab mein mere papa mere room mein aae vo sunke bolne lage beta kuch padhai karle ye kya dekh raha hai. Lol. nice content. fun learn. keep going harry bhai.

  • @SatyamKumar-eh5qg
    @SatyamKumar-eh5qg 2 роки тому

    Genuinely bhaiya this course is very helpful. Thank u

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

    22:44
    cout

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

      Harry Bhai apse nahi milenge kyun ki ap bohot bara gunah kar rahe ho(endl nahi laga kar😂😂)

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

    ek dum mst bhai sch m itna acha koi nhi pdhata bhai ek dum mst

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

    The way you taught pointers 💙❣️

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

    Love to watch your video's
    Keep uploading

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

    Thanks Harry bhai for your awesome vedioes

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

    u forget these-
    delete [ ] ptr;
    delete[ ] ptrtemp; nice explanation bro love it

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

      ptrtemp will not be deleted like this cause it's not dynamically allocated you need to delete only the ptr. You can set ptrtemp=NULL not to get the garbage value

  • @Elon-musk-007
    @Elon-musk-007 4 роки тому +1

    If anyone wants a better understanding they can read E Balagurswamy C++ book along with the videos . Same book vaala hi samjhaya hai Harry Bhaiya ne

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

    New viewer here. I absolutely love this course.

  • @trippyvoyager9879
    @trippyvoyager9879 8 місяців тому

    Rather then using this we can simply add by ptr[i];
    and then display with the same loop using same ptr[i]; to display you can try it it works

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

    very helpful videos for me I appreciate you your videos bro

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

    Congrats Guruji for 2M

  • @GauravSharma-ze4cu
    @GauravSharma-ze4cu 3 роки тому +2

    7:24 compiler devta be like -> Thatastu lekin class declare krne ke baad semicolon jrur lagana :)

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

    Harry bhai muje apka ptr ko loop mae increase karne ka tarika samaj nhi aya 16:07 to mene dusra tarika dunda
    // input for loop mae
    for (int i = 0; i < 3; i++)
    {
    cin>>n>>m;
    (ptr + i)->setdata(n, m);
    }
    // output for loop mae
    for (int i = 0; i < 3; i++)
    {
    (ptr + i)->getdata();
    }

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

    To avoid temp ptr we can use this :
    for(int i=0; igetdata(5);
    ptr++;

    }
    ptr--;
    for(int j=0; jprintdata();
    ptr--;

    }

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

    Thank you very for this C++ course...🙏🙏

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

    Another Amazing Lecture

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

    @CodeWithHarry Bhai God ho kya? Best explanation I could ask for!

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

    bilkul bhi tricky nhi laga ,thanks bhai ji!!!

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

    Sir we can do that thing without pointer too...I would like to request you to differentiate between the usage( means when exactly we need to allocate address using pointer followed by program and when we can do it normally)?

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

    Compiler devta🙇🙇

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

    Always support you Harry bhai

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

    Instead if incrementing ptr you should cout

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

      But i is getting added to ptr na. Can you explain how

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

      @@sit33darshanpagar16 I can't understand your question.

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

      ​@@shashijaiswal688bro you are incrementing the address which is stored in ptr instead of the value at the address at ptr. So, it'll most likely give an error. (I might be wrong!)

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

    Thanks Harry Bhaiya

  • @AniketPanche.
    @AniketPanche. 3 роки тому +5

    7:18 compiler Devta was epic one 🤣

  •  3 роки тому

    harry bhai ek din apka channel sbse bada tech education channel ban jayega puri duniya me

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

    Compiler dewta....what a word...Harry bhai.. 😁😁😁

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

    3:54 class works as an data type in Main fn😯

  • @AshishKumar-lr9vd
    @AshishKumar-lr9vd 3 роки тому

    Waaah ...maza aa gya dekh kar

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

    Awesome video bhai

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

    Very good playlist.

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

    Thank you so much Harry Bhai.

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

    Harry bai me tumara fan bangaya yar❤❤❤

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

    Please make a tutorial for computer architecture and organisations

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

    7:25 compiler devta 🤣;I love your desi style cwh:)

  • @freekeys
    @freekeys 4 роки тому +9

    Django react tutorial ❣️

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

    Its help me a lot .thnx vaiya 💙

  • @aniketsahi7778
    @aniketsahi7778 6 місяців тому

    🥳🥳🥳 thank you Harry bhai ✌️

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

    10:30
    Everyone knows for loop
    It is easy

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

    shared sir already share to my whole nallay friends, now they all are studying from here.

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

    compiler devtaa ! Nice one

  • @ryskathisside9281
    @ryskathisside9281 3 роки тому +9

    instead of temp we can also add (ptr +i) in both the loops
    int main()
    {
    class shop
    {
    int a, v;
    public:
    void setdata(int ab, int bc)
    {
    a = ab;
    v = bc;
    }
    void getdata()
    {
    cout

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

    at 16:50 you could've use ptr+i instead of ptr++ so you wouldnt have been needing temp

  • @thatowlfromhogwarts490
    @thatowlfromhogwarts490 3 роки тому +5

    If you would have simply written..
    ptr-=size; after 1st for loop
    It would have worked fine : )

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

      @CHOUDHARY HIMANSHU error didn't show up in my code bro, i am basically saying is that, he made a different pointer and some other stuff to run the next loop but i am simply resetting the same pointer...

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

      @CHOUDHARY HIMANSHU muja bhi same error aa rhi hai

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

      Right.. ptr=(ptr+3)-3 =ptr 👍

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

    legend admi ho tum bhai

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

    thanks bhai, maza agaya

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

    harry bhai you are awesome

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

    ❤❤💝HARRY BHAI

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

    Happy Teacher's day paaji

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

    compiler devta ..... ha ha ha ,, it was very funny , the video was awesome bro thanks

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

    mangaye yarr tumarae padhaneka tarikako, ko v samjhjayega.thanks dil se

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

    thank you harry bhai

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

    Wah G Wah ❤️❤️

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

    Thanks harry bhai 👍👍✌

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

    Thanks Harry Sir

  • @riturajft7177
    @riturajft7177 5 місяців тому

    Sir 🧠🗝️🔓 lectures ❤❤

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

    bro ek to aapke knowledge ko dekhkar confidence down hota jaata hai

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

    Desi style best hai bhai

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

    Thank You
    .
    .
    .

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

    Harry bhai apki vedio khulte hi pahle like aur phir comment

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

    Thank you so much !

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

    AAP MAHAN HO HARRY BHAU

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

    ha "class and object" ab halwa lagta hai😒. Thanks bhaiya 😎🙏🏽

  • @azizigill4495
    @azizigill4495 8 місяців тому

    There is no need to make *ptrTemp. Simply do not write ptr++ while taking input. The same output will be printed on the screen.

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

    thank you so much.,

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

    Naya pointer banake index reset karne ke bajay ham
    for loop ke baad ptr=ptr-size; or ptr-=size; like ke bhi index ko reset kar sakte hai....
    #include
    #include
    using namespace std;
    class shop
    {
    int id;
    int price;
    public:
    void getData(int a , int b)
    {
    id = a;
    price = b;
    }
    void print()
    {
    cout

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

      Garbage value aya hai is I'd 1 and 2 ka .