Friend Functions in C++ | C++ Tutorials for Beginners #26
HTML-код
- Опубликовано: 6 сен 2024
- Download the best IDE for C, C# and C++: bit.ly/WholeTo...
►Source Code & Resources: codewithharry....
►This video is a part of my C++ playlist: • C++ Tutorials In Hindi
►For Doubt Solving, Brain Storming Sessions & guaranteed replies, join the channel membership here: / @codewithharry
►Click here to subscribe - / @codewithharry
►Checkout my English channel here: / programmingwithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
I loved the Analogy 😂😂😂😂Compiler police, complex dost hai mera... That one 😂😂🔥
Yes, true...
"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
dii wanna suggest anything to a juniour starting programming>?
@@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
@@cleverqwerty4504 i chose c++ as I've studied it earlier And baki sari cheeze aapki krta hu folllow thnx di🙏
@@cleverqwerty4504 didi lag gayi kya placements
@@sagarbedare4491 😂😂
I really appreciate your efforts man. 74 videos completely free on RUclips is not a joke. Thanks a lot for this playlist.
binge watching it after 2 yrs💀
@@srijanmukherjee3648 you litreally fried
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
Nice analogy bro....👍
Puri vdo ko aap vaise bta diye😊.... 🙏 Thanks 😊
Sumcomplex is allow to do anything with my Private parts 🤣🤣🤣
😂😂😂,bas yahi comment ke liye vedio pause karke aaya😂😂😂..Harry Bhaiya continue...Padhai ke time aisi galatiya ,mood fresh kar deti hai
@@andromedagalaxy1266 same yrr ..me bhi iske liya aaya comment section me
@Lawerence Fierst hi bot , how are you
@Bryant Erick tum bhi bot ho , janta hu -_-
just stopped the video after this line to see this comment
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...
are bhai bhai bht mubaarak ho aapko
my name is also durgesh ☺
Which college? Your Jee rank?
which college
@@SnehaR380 u which college
I saw many videos of frnd function but i got it from here. Thanks a lot sir🙃
18:52 , he was about to say "Bilkul bhi samajh nahi aa rahi " but he refrained himself 😂.
😂😂😂
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.🥰
Same here bro done c for cp learning c++
yeah bro i completer 25 videos in one sitting because except cout and cin everything seems same and obviously "oops"
Hey bro will you explain me what is cp?
@@GaneshKumar-qs9kn competitive programming
@@mohammadmohsinmohammedmohs9717 Where such competition are organized?
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 :)
which cllg?
One million subscribers soon. You are great.
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
@@tanishchavan6472 check again bro
1.5 m now 🤣
@@zombiekiller7101 its now 1.6M😌
1.8M 😌🙂
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.
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
Which college
@@uused NIT Silchar
ha bhai final year complete ho gya 😁😁
placment hua?
Bro life kaisi chal rhi h
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.
Tomorrow is my paper of c++ oop and I'm clearing my concepts watching your well explained videos thanks buddy♥️♥️♥️
This is how studies and enjoyment go hand in hand 👌👌
Nice lecture 👍
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.
and a, b are private functions
@@satyamborade3954why there is complex written before sumcomplex function what does it mean....
Generally we write datatypes before the function name na???
@@aniket_k720 actually if you observe we are returning a complex number and so we have mentioned there the return type of function
@@satyamborade3954 mtlb i we can say that it is a rule to write class name then function name when we use friends function??
@@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
Nice, keep it up, very helpful videos you are making to help other programmers .
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
Are chintu tum😂.. well done bro🔥
Yes , as a beginner this videos is very helpful for me to learn a first programing language
Without knowledge of c programming .
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.
😊 thanks
also there is one bracket missing
you have high level of knowledge
@@rushikeshkhot5937 lol
watch full video!
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.❤
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.
sir very nice explanation : meri maujoodgi ka ahsaas dila rhi sir
You are my mentor sir!!!
I truly admire you, you are my inspiration. Keep doing well in life. God bless you.
Guy I just started watching your playlist it was very easy to understand and your amazing teacher
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!
😂
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!
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.
Enjoying the course so far. It is indeed proving to be helpful . Thanks.
Absolutely your playlists of this course is fantastic 😊
The way sir interpret compiler as police is really fascinating.
Heads off to your creativity.
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❤️
very good and interesting lectures on c++ , these type of teachers help students to learn new skills with fun . Thanks harry bhaiya.
Thanks for the help Harry bhai, Bohat Aala padhaya aapne. Love from Pakistan
I am loving the course. Great way to explain things. Thanks harry bhaiya😊❤
The best-ever explanation about programming languages in Hindi. Thank you so much Harry Bro.
Thanks bhai for this free c++ course
Great course!!
I really appreciate it what are u doing for us
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
Intresting lectures..... Top level content ❤️❤️❤️🎉🎉
Dude I love your c++ series ❤️ Thank You 🤗
I like your videos sir and it's really helpful.
Thanks for teaching us sir.
Love your way of explaining complex things so easily...
Keep up the great work..🙂🙏
Thanks a lot bhaiya........!! You are the best teacher ever I know and have had been studied from.....Thanks a lot..!!
call kar liya complex ko 😂you are best teacher 🤞keep it up bro
Such lucid and easy description. No wonder Harry bhai has such a massive student pool.
The concepts are getting even more clear by following your C++ videos.
The videos are really very helpful.
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.
8:00 Error dega :- one closing parenthesis, private member access out of the class
Hey, I am seeing second comment of yours
@@AshutoshKumar-fu6qe oh😁
I don't like the way how my college sir explain c++
But i like the way how harry bhai teaches us ❤️
Exactly 😌
Harry bhai the course you gives us is very helpful. Thank you so much to help us. 😇
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.
Finally, I changed my branch from EC to CS in 3rd sem in RTU(Kota,Rajasthan)🥳🥳
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.
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
@@harcharansingh1997 Likh to skte h. Lekin vaise likh dete to friend function ka use hi kya hua.
The most interesting and knowledge full videos on the whole internet i think
I am really enjoying the course and the way you are making us understand the concepts is extraordinary.
14:39 was really hilarious. I laughed hard. Wonderful explanation.
[8:00] Code mein error aayega ..... kyunki harry bhai ending parenthesis lagana bhul gaye hain
sir thanks you are a great man in the days of 2021st century no one care about any one they only wantmoney . but you sir you are great you want teach us not make money by us .
thanks sir .
7:56:
error:
a and b are private members
Declaration can be done anywhere ie private or public section but that doesn't means that we are making it private or public
(error aayega ,kyuki complex class ka a and b private function h)
Correct
#include
using namespace std;
int main()
{
std::cout
Really awesome video!
Can not stop myself from commenting.
isse kehte hain study with fun.
course is very helpful and the analogy, "Compiler devta" in all of the video," is one and only piece"😂😂
course is very helpful and useful harry bhai.14:50 is funny 🤣😂🤣😂.
Harry bhai me apki c++ ki Playlist revision ke liye dekh rha hu. this
Playlist really awesome 👌.because I learn new concepts thank bhai 🙏🏻 🙌
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.
Easiest Example (friend class)
#include
using namespace std;
class Sum;
class A{
int num1;
friend class Sum;
public:
void input(int number){
num1 = number;
}
};
class B{
int num2;
friend class Sum;
public:
void input(int number){
num2 = number;
}
};
class Sum{
public:
void printSum(A o1,B o2){
cout
Can u plz tell me this program name?
Is it wap to add two numbers using friend function??
@@barnwalpuja9565 It is a program in which the class Sum is the friend class of A and B class. Sum class have a function called printSum which accepts two number of object of class A and B then finally sum those number.
I Hope You can understand what I'm trying to say.
My best teacher ever ❤❤❤
Very good explanation bro.....I had never heard like this🔥💯❤
Learning and enjoying the same time , I have never experienced it before
Thank you so much bhaiya
you are very nice person and intellectual persons.
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
Sir the way you are making things easy are really amazing and we are learning C++ with fun😍😍.
I have another analogy: Let's suppose you are going to get an ID card made. They tell you to go to any government school and get a signature from the principal on your document. Here, the principal acts like a compiler who signs our document, and then we go back to the office. Once we have the signature, we get permission, and they accept it. However, this does not make us a member of the school where the principal signed our document.
the sumcomplex function is declared outside of the class braces hence it should not be able to access the private data of the objects declared using that class as a blueprint
I love the way you explain things Harry bhai , I love that compiler police one 😂😂
timeline?
thoda ajeeb likh diya maine XD ...... this is why i learn coding from u. beautiful manner of teaching with analogies and u make it fun to learn.
Very good playlist. I'm learning whole c++ from hary bhai. Thank You Harry Bhai 😊
Very Helpful
Thank You Brother lots of love
💌
Love from Bangladesh
Sir bahot maza aa rha h bss thodi confusion ho jaati h agar ek doubt session aap C++ ka rakh lenge toh bahot help ho jayegi
Thank You for making this playlist
14:54 Don't worry Harry bhaiya, हम सब समझ गए... 😂😂😂
Awesome explanation bhaiya ❤
Experiencing the capability of stroutup's work and computers
its really detail course i know c++ coding but this opps concept is really great
Awesome video😎😎👍👍
If you are clear with same topic then harry is great otherwise very difficult to understand.
Analogy ki wajah se samjha friend function, kudos bruh🙏🙏👍
your teaching is very much usefull and easy to understand with the daily life examples you give.
19:11 Yes these videos are really so much helpful for us.. Thank u so much Harry Bhaiyya!
here is the code for the friend function, thanks for the session mate:
code:
#include
using namespace std;
// creating a class complex to handle the functions relating to the complex numbers
class complex{
int a;
int b;
public:
void normalset(int x, int y);
friend void setbysum(complex c1,complex c2);
};
/*normalset(): to take any two numbers from the user and print the complex number corresponding to those
numbers*/
void complex :: normalset(int x, int y){
a = x;
b = y;
cout
C ho gya cpp kr ra hu (friend function tk)ab dsa start karunga after endsem
Just want to say thanks for this course
8:06 -- it throws an error......love your teaching bhaiya
Bhai kya mst analogy se samjaya pehale samaj nahi aaya hua tha friends function but ab acche se samaj aagya thanx a lot bhaiya🥺🙌🏻🙌🏻
Thankyou HARRY BHAI for providing all this for free!
You can think of it like you are friend-zoned ,so you access private members but only through objects not directly.
thanks for watching and i will see you in the next time
You are doing such a great work, thanku for this course 💚
Thankyou for your vidoes . ❤️. Really helpfull .