Friend Functions in C++ | C++ Tutorials for Beginners #26

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

Комментарии • 1,7 тыс.

  • @shivanshgoyal310
    @shivanshgoyal310 4 года назад +432

    I loved the Analogy 😂😂😂😂Compiler police, complex dost hai mera... That one 😂😂🔥

    • @priyanshkumar17
      @priyanshkumar17 Год назад +2

      Yes, true...

    • @krishnabansal17
      @krishnabansal17 Месяц назад

      Maja toh aa rahi hain series' main starting main oops ke concept dimag ke upar se nikal rhe the but abb sab samajh aa raha hain, thanks harry bhai.

  • @cleverqwerty4504
    @cleverqwerty4504 3 года назад +550

    "Mai ek simple si class banaunga, maan lo 'Complex' " 😂 BTW great series :) Agar iss baar kahi place ho gayi to wo aapke wajeh se hoga

    • @vaibhav7457
      @vaibhav7457 3 года назад +10

      dii wanna suggest anything to a juniour starting programming>?

    • @cleverqwerty4504
      @cleverqwerty4504 3 года назад +47

      @@vaibhav7457 Ek programming language select karo and learn everything about it. DSA ache se padho nahi to placements ke time pe dard hoga. And DBMS padh lo please, its boring and time consuming but saare companies ko chahiye... Last tak kuch mat chodna pleaseeeeeeeeee

    • @vaibhav7457
      @vaibhav7457 3 года назад +4

      @@cleverqwerty4504 i chose c++ as I've studied it earlier And baki sari cheeze aapki krta hu folllow thnx di🙏

    • @sagarbedare4491
      @sagarbedare4491 2 года назад +20

      @@cleverqwerty4504 didi lag gayi kya placements

    • @risinghard907
      @risinghard907 2 года назад +4

      @@sagarbedare4491 😂😂

  • @it_does_matter
    @it_does_matter 3 года назад +245

    I really appreciate your efforts man. 74 videos completely free on RUclips is not a joke. Thanks a lot for this playlist.

  • @durgesh2493
    @durgesh2493 2 года назад +213

    Finally got placed in VISA Inc. A big thanks to Code With Harry for providing such beautiful and easy explanations to such complicated topics. Just want to meet Harry sir IRL once...

    • @kumkumbhagya51
      @kumkumbhagya51 Год назад +9

      are bhai bhai bht mubaarak ho aapko

    • @Samael_editx
      @Samael_editx Год назад +6

      my name is also durgesh ☺

    • @SnehaR380
      @SnehaR380 Год назад +8

      Which college? Your Jee rank?

    • @abhi.1867
      @abhi.1867 Год назад +3

      which college

    • @abhi.1867
      @abhi.1867 Год назад +1

      @@SnehaR380 u which college

  • @shatviksmit3388
    @shatviksmit3388 3 года назад +69

    Sir, I have thought of a good analogy to explain friend function
    Suppose I have one friend which my parents do not know of, and one day he suddenly comes to our home.
    So, my parents will stop him coming home because they don't know about him then he will say I am a friend of your son. Then they will say, how can we believe you and then he will call me and then I will tell my mum that yes he is my friend. But, this doesn't make him a member of our family, he has some limits in which he has to operate
    In this example, my parents are compiler, I am a class and my friend is a foreign function

    • @subharoopkabi7842
      @subharoopkabi7842 6 месяцев назад +3

      Nice analogy bro....👍

    • @anilverma9268
      @anilverma9268 2 месяца назад

      Puri vdo ko aap vaise bta diye😊.... 🙏 Thanks 😊

  • @SuperHironmoy
    @SuperHironmoy 2 года назад +15

    Hi harry, I started this course from few days ago and I really appreciate your work. You're doing a great job and I thanks to teach us in very simple and understandable way.

  • @abhishekkhandare4872
    @abhishekkhandare4872 4 года назад +82

    I saw many videos of frnd function but i got it from here. Thanks a lot sir🙃

  • @tayyab.sheikh
    @tayyab.sheikh Год назад +7

    18:52 , he was about to say "Bilkul bhi samajh nahi aa rahi " but he refrained himself 😂.

  • @rickk3300
    @rickk3300 3 года назад +64

    8:05 a and b are private data members, hence they can't be accessed using the dot operator. They can only be accessed inside any member function.

  • @SamarthChawlaSam
    @SamarthChawlaSam 3 месяца назад +1

    19:09 This course is so much useful for me as I am going in first year of my college and learning C++ skill is one of the best activity which helps me to utilize my time in a productive and creative way. Thanks a lot Harry Bhaiya.

  • @ranjeet2204
    @ranjeet2204 4 года назад +174

    Dude , Love your C++ series.
    I want to start CP that's why I am learning C++.
    As I already learned c so it's not that much difficult for me to understand.
    Thank you bro for you effort.🥰

  • @rishabhprasad7145
    @rishabhprasad7145 2 года назад +21

    Great videos, I learned complete c and c++ programming from your channel. I am a civil engineering student but was interested in coding and because of your channel I am realizing my dream. Thanks bro for supporting millions of students like us :)

  • @TheISP
    @TheISP 4 года назад +22

    8:08 -- The program throws an error stating that a parenthesis is expected to close the sumComplex() function. Also, I am very thankful Harry bhai! I have learnt a lot in this series.

    • @satyamborade3954
      @satyamborade3954 3 года назад +1

      and a, b are private functions

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

      @@satyamborade3954why there is complex written before sumcomplex function what does it mean....
      Generally we write datatypes before the function name na???

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

      @@aniket_k720 actually if you observe we are returning a complex number and so we have mentioned there the return type of function

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

      @@satyamborade3954 mtlb i we can say that it is a rule to write class name then function name when we use friends function??

    • @satyamborade3954
      @satyamborade3954 2 года назад +1

      @@aniket_k720 no, Here Complex is the name of class and we are making another complex number using that class and then returning it so we need to write the return type of function as complex

  • @rajatshukla2605
    @rajatshukla2605 2 года назад +5

    Enjoying the course so far. It is indeed proving to be helpful . Thanks.

  • @adityagamingofficial2523
    @adityagamingofficial2523 4 года назад +367

    Sumcomplex is allow to do anything with my Private parts 🤣🤣🤣

    • @andromedagalaxy1266
      @andromedagalaxy1266 3 года назад +66

      😂😂😂,bas yahi comment ke liye vedio pause karke aaya😂😂😂..Harry Bhaiya continue...Padhai ke time aisi galatiya ,mood fresh kar deti hai

    • @ashwinpatidar8557
      @ashwinpatidar8557 3 года назад +9

      @@andromedagalaxy1266 same yrr ..me bhi iske liya aaya comment section me

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

      @Lawerence Fierst hi bot , how are you

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

      @Bryant Erick tum bhi bot ho , janta hu -_-

    • @shakshi9108
      @shakshi9108 3 года назад +3

      just stopped the video after this line to see this comment

  • @engineerbhai7642
    @engineerbhai7642 4 года назад +64

    One million subscribers soon. You are great.

    • @tanishchavan6472
      @tanishchavan6472 4 года назад +1

      y harry bhai not has 1 million reach till now
      that is so bad
      this is the best channel i have seen
      it deserve more than 5 million definitely

    • @SahilKumar-rz3th
      @SahilKumar-rz3th 3 года назад +3

      @@tanishchavan6472 check again bro

    • @zombiekiller7101
      @zombiekiller7101 3 года назад +1

      1.5 m now 🤣

    • @soniyapol5755
      @soniyapol5755 3 года назад +1

      @@zombiekiller7101 its now 1.6M😌

    • @zombiekiller7101
      @zombiekiller7101 3 года назад +3

      1.8M 😌🙂

  • @chandanramteke7001
    @chandanramteke7001 2 года назад +16

    This is how studies and enjoyment go hand in hand 👌👌
    Nice lecture 👍

  • @kunalmodi6814
    @kunalmodi6814 3 года назад +34

    I am currently in the 3rd year of engineering and this really helped, ngl. You really dont miss any important points or scenarios that we ignore most of the time. Really appreciate that. Keep doing the good work

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

      Which college

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

      @@uused NIT Silchar

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

      ha bhai final year complete ho gya 😁😁

    • @abhi.1867
      @abhi.1867 Год назад

      placment hua?

    • @historiot-yt
      @historiot-yt Год назад

      Bro life kaisi chal rhi h

  • @AbhinavKosta
    @AbhinavKosta Год назад +1

    The way sir interpret compiler as police is really fascinating.
    Heads off to your creativity.

  • @dharmik5442
    @dharmik5442 3 года назад +5

    You are my mentor sir!!!
    I truly admire you, you are my inspiration. Keep doing well in life. God bless you.

  • @MuhammadJameel-w6d
    @MuhammadJameel-w6d 10 месяцев назад +4

    Nice, keep it up, very helpful videos you are making to help other programmers .

  • @khuramnawaz358
    @khuramnawaz358 3 года назад +14

    Tomorrow is my paper of c++ oop and I'm clearing my concepts watching your well explained videos thanks buddy♥️♥️♥️

  • @sys7emH4cked
    @sys7emH4cked 2 года назад +7

    Absolutely your playlists of this course is fantastic 😊

  • @syedammarali108
    @syedammarali108 4 года назад +6

    Really enjoying this course and it is very helpful for me.
    thanks for creating this course and others too.
    It is very helpful for each and everyone.
    Best channel for coding.

  • @anshpandey6015
    @anshpandey6015 Год назад +1

    Yes , as a beginner this videos is very helpful for me to learn a first programing language
    Without knowledge of c programming .

  • @rambhardwaj5555
    @rambhardwaj5555 4 года назад +6

    Hi bhai m class 10 m hu
    Maine aapki python ki full playlist dekhi h
    M ab python programming acche s seekh raha hu
    Maine class 9 se python start ki thi
    Thanks bhai

  • @namanjain1426
    @namanjain1426 3 месяца назад +1

    Guy I just started watching your playlist it was very easy to understand and your amazing teacher

  • @zeevlogs4250
    @zeevlogs4250 4 года назад +10

    Harry Sir you are my amazing teacher of C++ I love you
    I am preparing for my university exams of OOP with the help of your C++ Series and also I shared it with my university members before when I did not know anything about C++ I was very upset but your first videos encouraged me to learn it you made this series very very interesting, enjoyable and entertaining I respect you a lot I appreciated your hardworking please keep it up and your series made me unique among my class fellows and hope so that I will get a better result in exams ,
    again thanks a lot I have no words about your appreciation
    again thanks lot
    Love you from Pakistan.

  • @achalsayee2534
    @achalsayee2534 2 года назад +2

    course is very helpful and useful harry bhai.14:50 is funny 🤣😂🤣😂.

  • @ahmadqazi9291
    @ahmadqazi9291 3 года назад +13

    I m really enjoying this course. Its full of Practical, Knowledgable & Latest one. As a student of Computer science it's very beneficial for me to Learn Advance levels even which are not covered by university curriculum, that you provide us . Thanks alot sir Harry, I love you!

  • @rohitgehlot5621
    @rohitgehlot5621 Год назад +1

    I'm one of the most famous coder of my class & all that bcoz of you.. Thank you so much & I'm repaying u by suggesting you every person i meet related to coding.❤

  • @arjunsolanki752
    @arjunsolanki752 3 года назад +5

    I am loving the course. Great way to explain things. Thanks harry bhaiya😊❤

  • @ritechaserious
    @ritechaserious 6 месяцев назад +3

    sir very nice explanation : meri maujoodgi ka ahsaas dila rhi sir

  • @nikhilsrivastava311
    @nikhilsrivastava311 4 года назад +21

    8:00 Error dega :- one closing parenthesis, private member access out of the class

  • @AkmJustStarted
    @AkmJustStarted 2 года назад +5

    Great course!!
    I really appreciate it what are u doing for us

  • @piyushjain8340
    @piyushjain8340 3 года назад +13

    very good and interesting lectures on c++ , these type of teachers help students to learn new skills with fun . Thanks harry bhaiya.

  • @human_being9
    @human_being9 Год назад +1

    The best-ever explanation about programming languages in Hindi. Thank you so much Harry Bro.

  • @rupesh_1908
    @rupesh_1908 3 года назад +6

    Intresting lectures..... Top level content ❤️❤️❤️🎉🎉

  • @davidmitnick7729
    @davidmitnick7729 Год назад +1

    After 3 years harry's this playlist is also lightening whole world of IT with its bright light. Through this masterpiece on the RUclips you can get free access to the top level content. I just want to provide complements to the Harry bhi for such a blessed playlist. Thanks!

  • @gauravsrivastava5947
    @gauravsrivastava5947 3 года назад +6

    Dude I love your c++ series ❤️ Thank You 🤗

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

    8:06 -- it throws an error......love your teaching bhaiya

  • @manavroy7293
    @manavroy7293 3 года назад +3

    I like your videos sir and it's really helpful.
    Thanks for teaching us sir.

  • @shuvbhowmickbestin
    @shuvbhowmickbestin 2 года назад +1

    Such lucid and easy description. No wonder Harry bhai has such a massive student pool.

  • @senpaitalks939
    @senpaitalks939 2 года назад +6

    Damn am looking forward to finishing this series and learn Java and python also from you sir . Damn your videos increases my curiosity to learn more and more

  • @chandrakantagrawal674
    @chandrakantagrawal674 3 месяца назад +1

    14:54 Don't worry Harry bhaiya, हम सब समझ गए... 😂😂😂

  • @englishgamer2503
    @englishgamer2503 Год назад +3

    Thanks bhai for this free c++ course

  • @lyrical89017
    @lyrical89017 3 года назад +4

    call kar liya complex ko 😂you are best teacher 🤞keep it up bro

  • @AryanUbale-p3p
    @AryanUbale-p3p 3 дня назад

    This course is very helpful for my academics and practical understanding of concepts

  • @prasoon054
    @prasoon054 4 года назад +5

    8:00 Error. 2 wajah se. Pehli to ye ki aap private member ko access krne ki koshish kr re. Or dusri baat ye ki line 23 p 1 closing parenthesis missing h.

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

      At 5:22 why we cannot able to write direct object of complex class instead of writing o1 and o2 so that we can write c1 and c2 , what is major difference bro reply asap

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

      @@harcharansingh1997 Likh to skte h. Lekin vaise likh dete to friend function ka use hi kya hua.

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

    19:11 Yes these videos are really so much helpful for us.. Thank u so much Harry Bhaiyya!

  • @shubhambara5444
    @shubhambara5444 4 года назад +8

    Love your way of explaining complex things so easily...
    Keep up the great work..🙂🙏

  • @akasksingh2625
    @akasksingh2625 3 года назад +1

    The most interesting and knowledge full videos on the whole internet i think

  • @jaspreet15
    @jaspreet15 Год назад +3

    Amazing videos sir
    Starting mein oops krte time problem arhi thi hard lg raha tha
    But practice and revision se ab easy lg raha hein oops 😊
    Thanks for the quality content sir❤️

  • @anusharandhawa8152
    @anusharandhawa8152 Месяц назад

    i learned java for an earlier course from codewithharry and after an year i began c++ playlist and mannn YOU ACE IT AND HOW BEAUTIFULLY YOU EXPLAIN THINGS I COULD UNDERSTAND EACH N EVERYTIHNG ITNE ACHEY SE
    KEEP UP THE GOOD WORK!!!!

  • @aishwaryadwivedi5150
    @aishwaryadwivedi5150 4 года назад +10

    The concepts are getting even more clear by following your C++ videos.
    The videos are really very helpful.

  • @ashhmuds1173
    @ashhmuds1173 2 года назад +1

    14:39 was really hilarious. I laughed hard. Wonderful explanation.

  • @Down2HellBBX
    @Down2HellBBX 2 года назад +3

    [8:00] Code mein error aayega ..... kyunki harry bhai ending parenthesis lagana bhul gaye hain

  • @heftypledge8709
    @heftypledge8709 2 года назад +1

    Thanks a lot bhaiya........!! You are the best teacher ever I know and have had been studied from.....Thanks a lot..!!

  • @Hadi-th5jc
    @Hadi-th5jc 3 года назад +3

    I don't like the way how my college sir explain c++
    But i like the way how harry bhai teaches us ❤️

  • @SurajKumar-sj4up
    @SurajKumar-sj4up 2 года назад +1

    14:40 Harry bhai yeh kis line mai aa gaye aap 😂😂😂

  • @eshansharma9458
    @eshansharma9458 4 года назад +8

    7:56:
    error:
    a and b are private members

  • @ronakmaniya2005
    @ronakmaniya2005 6 месяцев назад +1

    Harry bhai the course you gives us is very helpful. Thank you so much to help us. 😇

  • @Hasan7302
    @Hasan7302 3 года назад +4

    I am really enjoying the course and the way you are making us understand the concepts is extraordinary.

  • @shreyashkashyap
    @shreyashkashyap 2 года назад +2

    In the complex number addition function, it is not possible to add the complex nos. that way because two private variables a and b are used there, and that function is outside of the class 'Complex'. So, it will throw an error saying that Private vars cannot be used directly outside the class where they are initialized/declared.

  • @shivamchansoriya4460
    @shivamchansoriya4460 3 года назад +6

    Great work Harry bhaiya ❤️ your videos are so easy to understand & the way you teaches is incredible🔥🔥🔥, you have made C++ language so effortless to learn. Thanks for providing this course at free of cost.

  • @_TheInquistive
    @_TheInquistive 11 месяцев назад +1

    Awesome explanation bhaiya ❤
    Experiencing the capability of stroutup's work and computers

  • @swatikeshrwani831
    @swatikeshrwani831 4 года назад +7

    (error aayega ,kyuki complex class ka a and b private function h)

  • @than0s869
    @than0s869 2 года назад +1

    Harry bhai me apki c++ ki Playlist revision ke liye dekh rha hu. this
    Playlist really awesome 👌.because I learn new concepts thank bhai 🙏🏻 🙌

  • @user-dn4bv4iw6z
    @user-dn4bv4iw6z Год назад +3

    me jinda hu

  • @atulsoam472
    @atulsoam472 3 года назад +1

    loving series sir ji helping a lot thankyou.................THANKS BHAIYA...

  • @AhmedRaza-ty7zq
    @AhmedRaza-ty7zq Год назад +1

    8:00 We can't access the private members of the class so the program will throw an error saying we cannot access the private member and the solution is to make a friend function with the function parameter of the Complex class.😅🙂

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

    Analogy ki wajah se samjha friend function, kudos bruh🙏🙏👍

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

    19:00 ha bhai bht maza aa rha hai is course mai ❤

  • @PareeksAcademy10october2001
    @PareeksAcademy10october2001 3 года назад +1

    Finally, I changed my branch from EC to CS in 3rd sem in RTU(Kota,Rajasthan)🥳🥳

  • @ashokbalgurgi1382
    @ashokbalgurgi1382 8 месяцев назад +1

    Very good explanation bro.....I had never heard like this🔥💯❤

  • @akshaycodex9568
    @akshaycodex9568 2 года назад +2

    Mujhe lagta hai me c++ ka master ho jaoga ...phir DSA ..😀😊🌹🌹🌹🌹💐💐💐💐💐

  • @sDa_E_23
    @sDa_E_23 Год назад +1

    7:49 Output is 6 + 12i

  • @kunalshahare9041
    @kunalshahare9041 3 года назад +1

    thank you sir bahut shandar padhaya hai aapne c++

  • @redstarmuteff7658
    @redstarmuteff7658 Год назад +1

    My best teacher ever ❤❤❤

  • @faizankhan-xb2ut
    @faizankhan-xb2ut Год назад +2

    when harry bhai says compiler ek police ki tarah hai😄😄

  • @AnkurTheHOD
    @AnkurTheHOD 2 года назад +1

    Learning and enjoying the same time , I have never experienced it before
    Thank you so much bhaiya

  • @Ansarieng
    @Ansarieng 3 года назад +1

    sir your video's are great and i learn cpp from your content because the way you teaches is excellent and i enjoying this cpp course

  • @kumkumverma6546
    @kumkumverma6546 Месяц назад

    These vedios are very helpful to learn cpp. Thank you .

  • @AnEngineerHuman
    @AnEngineerHuman Год назад +1

    8:00 error aayega bcz a and b are private.Private variables can only be accessed in the class or in the functions which are defined in the same class where these private variables defined

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

    8:07 Here we are declaring object outside the main function, so the object is not defined.

  • @muhammadsuhail2364
    @muhammadsuhail2364 7 месяцев назад

    Sir aapke example se friend function clear ho gya🎉🎉

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

    Sir best explanation bhut easy way mai clear krvate hai❤🎉

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

    At 14:51 Your concentration in learning is checked🙂

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

    #include
    using namespace std;
    int main()
    {
    std::cout

  • @chillvibes71
    @chillvibes71 2 года назад +1

    Thankyou for your vidoes . ❤️. Really helpfull .

  • @prateeklikhar1893
    @prateeklikhar1893 3 года назад +1

    nice video ,,,,,,,keep doing what u doing.Hope u reach more success

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

    sir sir sir, aapki coding videos bhot zada achi hain. Best in India. Teaching is an art and you are an artist of logical expression.

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

    Really awesome video!
    Can not stop myself from commenting.
    isse kehte hain study with fun.

  • @Error7Easin
    @Error7Easin 8 месяцев назад

    Very Helpful
    Thank You Brother lots of love
    💌
    Love from Bangladesh

  • @AhmedRaza-ty7zq
    @AhmedRaza-ty7zq Год назад +2

    Awesome video😎😎👍👍

  • @Uzairkhan-dv6hz
    @Uzairkhan-dv6hz 9 месяцев назад

    Bahut badia Teaching method hai Harry Bhaia ap ka. Keep it up👍

  • @ABHISHEKMISHRA-ew7fm
    @ABHISHEKMISHRA-ew7fm Год назад

    sir bohot accehse se samjhate ho sarre topics ...thanks a lot !!!!

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

    your teaching is very much usefull and easy to understand with the daily life examples you give.

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

    8:00
    Run nahi hoga i guess kiyuki a,b private:🔏🔏🔏🔏me declared hai aur hamara sumComplex function out of class🔥🔥🔥

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

    i dont think someone can explain this with more fun and dedication