Friend Functions in C++ Programming | Object Oriented Programming in C++

  Рет қаралды 206,183

Simple Snippets

Simple Snippets

Күн бұрын

Пікірлер: 174
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌
@anuish04
@anuish04 4 жыл бұрын
plz make a video lecture on "COMPOSITION IN C++"
@sushamaavaghade9945
@sushamaavaghade9945 3 жыл бұрын
Okk sir
@sushamaavaghade9945
@sushamaavaghade9945 3 жыл бұрын
But sir screen is not visible clearly
@OmegaJazz
@OmegaJazz 6 жыл бұрын
Great Lecture bro. IDK why my teachers can't teach so well. He just comes in the class with slides and just literally reads out the slides.
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Hehe thanks buddy. I'm glad you liked this video. Well about the other teachers, everyone's got different styles, can't really blame them anymore especially now when you have other options like this KZbin video and many others resources online 😉 BTW I also have an article on our official website on this topic if you want to prepare answer ✌️ Link in the description 😇
@arnavsaha3631
@arnavsaha3631 2 жыл бұрын
Same
@ដង្កូវសៀវភៅ
@ដង្កូវសៀវភៅ 4 жыл бұрын
Well done bro. I’ve gone through friend function with my lecturer about 5 months ago and got nothing but now I’m here be able to use friend function clearly. Thanks a lot and always support you and your videos.
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Glad I could help! Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@theears995
@theears995 3 жыл бұрын
Thank you! This is an amazing explanation - the friend keyword always confused me, and now I finally understand it!
@heartsonny
@heartsonny 2 жыл бұрын
Your explanations are so clear. Thanks !!
@LegitSpartaN118
@LegitSpartaN118 3 жыл бұрын
Absolutely great videos that have helped me pass my C++ at university, great stuff bro
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Oh that's amazing to know. Please do share the videos with your friends and juniors too. It might help them as well 😊
@swithikamutyam4976
@swithikamutyam4976 4 жыл бұрын
Superb explanation! The way you teach is so simple and much easier to understand.
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thank you so much buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@neerajmahapatra5239
@neerajmahapatra5239 5 жыл бұрын
You have a great talent ...your videos will be universally viral .. Your way is simple. Your english is awesome.. You are really a good teacher.. Just keep on making video... My first earning after i will become app developer will be to you and saurabh shukla sir...(my sirg).....😍😍😍
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thanks Neeraj, your comments and support means a lot to me 😇
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Do let me know about your app as well. Surely will be happy to know about it 😊
@neerajmahapatra5239
@neerajmahapatra5239 5 жыл бұрын
@@SimpleSnippets ya sure sirr
@jamesnash9675
@jamesnash9675 2 жыл бұрын
you are the best..........masum
@n_rounder6192
@n_rounder6192 3 жыл бұрын
Great help when exams are coming Thank you sir
@hoorainnoor1353
@hoorainnoor1353 4 жыл бұрын
a good tutorial i build this program on codeblocks so their is no error it runs successfully and gives the out put same like your
@sunnyjain630
@sunnyjain630 4 жыл бұрын
very simple and easy way of explanations!! it all clear my doubts about friend function thank you boss!!
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
That's amazing to know Sunny 😇 thanks for this wonderful feedback. Please do share the videos with your friends too 👍
@davirafaelfranke9303
@davirafaelfranke9303 4 жыл бұрын
thank you very much for this video! i had a question on my college test asking this can you also explain what is a client class? id be pleased
@harshvardhansingh780
@harshvardhansingh780 3 жыл бұрын
No words to say .... fabulous video
@prasannas8883
@prasannas8883 6 жыл бұрын
Because of you I would get get good marks in cs..Thank you😊
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much buddy. You really made my day by this comment 😇🙏 Means a lot to me. Do share the videos with your friends too ✌️
@kunalbahirat7795
@kunalbahirat7795 2 жыл бұрын
Those who do not know about the access specifiers (public,private,protected). first watch that video and then come here. for better understanding!!
@ajgamer3888
@ajgamer3888 3 жыл бұрын
That was great and wonderful explaination from scratch.. well done bro👍👍👍
@pritishpattnaik4674
@pritishpattnaik4674 Жыл бұрын
crystal clear explanation bro
@tanzengyang3760
@tanzengyang3760 4 жыл бұрын
Actually we declare void Distance::addValue {} if we want to access outside class ...C++ is so confusing. nice explanation..
@siddhigolatkar8558
@siddhigolatkar8558 3 жыл бұрын
I'm currently not working so I am not in a position to donate as of now but the least I can do is to watch ads.
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
You don't have to donate ever 😊 but please keep sharing our channel & videos with your friends. That's the biggest help & support you can provide 👍✌️
@vidhioswal9188
@vidhioswal9188 3 жыл бұрын
Explained it so well , thank you!
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Glad it was helpful!
@vu5700
@vu5700 4 жыл бұрын
Amazing tutorial,good job sir :)
@UsamaKhan-ct4bc
@UsamaKhan-ct4bc 2 жыл бұрын
very good teacher. really appreciate.
@vedangkavathiya8426
@vedangkavathiya8426 4 жыл бұрын
Thanks brother... Nice explanation...🙂
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Welcome 😊Please support me by sharing our videos with your friends too bro ✌
@aayushadhikari7851
@aayushadhikari7851 3 жыл бұрын
GOD level teaching
@308_akashsharma2
@308_akashsharma2 4 жыл бұрын
thanks you! this lecture cllears my doubt.
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Glad to hear that!
@lokanathanganesan6070
@lokanathanganesan6070 3 жыл бұрын
Thank you sir. The explanation was nice and I can understand them easily.
@easyconcept5677
@easyconcept5677 Жыл бұрын
craaa gl baat!👌
@laibahameed4212
@laibahameed4212 2 жыл бұрын
God bless you,so much honour and likes 🤩from Pakistan🇵🇰🇵🇰
@duck_roster
@duck_roster 6 ай бұрын
Great explanation
@vedantghate92
@vedantghate92 3 жыл бұрын
you are superb bro.......
@thephysicist989
@thephysicist989 3 жыл бұрын
Out of curiosity, how does your visual studio look so old? I actually like that classic look
@swarupaswaru4361
@swarupaswaru4361 6 жыл бұрын
Really excellent it is helpful for tomorrow's exam thank you for this
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much for such a positive feedback. I'm glad this will be helpful for your exam. Please share this with your friends too as even they will get help from this 😇 Ohh and all the best 😇✌️
@swarupaswaru4361
@swarupaswaru4361 6 жыл бұрын
Tanq
@abdulqadoos80
@abdulqadoos80 3 жыл бұрын
Outstanding bro
@hihi1124
@hihi1124 6 жыл бұрын
Will you make tutorials with data structures like stacks, binary tree and SLL or DLL?
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Yes definitely, infact in a recent video where I updated all channel subscribers, I said I will be covering 3 subjects on priority and asked for suggestions. The 3 subjects are Core Java, DS with C++ and C# .NET. So yes Data structures will soon be covered completely on the channel ✌😇
@nirajjain04
@nirajjain04 5 жыл бұрын
Explanation level 999!💥😅
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thanks bro ♥️
@timewrath7723
@timewrath7723 4 жыл бұрын
So, what else does a friend function do, aside from being able to access private elements? I'm not sure what else the friend function did in the main() function.
@adnanrasheed4366
@adnanrasheed4366 9 ай бұрын
Thank you very Much sir
@kanhiyamittallyrical
@kanhiyamittallyrical 3 жыл бұрын
Thanku sir, great explanation 👌
@kannadasanr9849
@kannadasanr9849 4 жыл бұрын
Hai bro , I want to learn component object modeling in C++ . Do you have any video tutorials for that. Or just give me suggestions for how to begin.
@himanshubhatt6240
@himanshubhatt6240 3 жыл бұрын
Loved this🧡♥️
@okprogrammer
@okprogrammer 6 жыл бұрын
please make a video on "this" pointer in c++. And you are aswesome!!
@okprogrammer
@okprogrammer 6 жыл бұрын
**awesome!!
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Okay buddy I'll make a video on this topic soon ✌️
@NormieMob
@NormieMob 5 жыл бұрын
Tomorrow I have practical exam helped me understand
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thats great to know buddy, please do subscribe& share the video with your other friends too :-) 😇
@oscarwang7920
@oscarwang7920 5 жыл бұрын
Nice work bro !
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thanks bro ✌️
@ameelaaslam7328
@ameelaaslam7328 4 жыл бұрын
Guys Mara final paper ha oop ka or kuch ata e ni abi tk , ab ma try kr ry hyn k prepare ho jy please dua kryn Mary liy
@bestsaurabh
@bestsaurabh 4 жыл бұрын
Can we have a friend class as well to access private members just like the friend functions?
@mahesh-jg3zx
@mahesh-jg3zx 5 жыл бұрын
Sir what is the use of & symbol why we are using it
@akshatvyas2594
@akshatvyas2594 4 жыл бұрын
Why passing d1 argument in addValue function.
@funnkidunyan1940
@funnkidunyan1940 3 жыл бұрын
How you speak flowly👌🏻
@sreehari4485
@sreehari4485 3 жыл бұрын
Pever💥
@aarjavbaxi2299
@aarjavbaxi2299 4 жыл бұрын
i didnt understand what does that (distance &d); mean..can someone explain??
@Mahesh-wr6uc
@Mahesh-wr6uc 5 жыл бұрын
Sir can you kindly provide vedios on dynamic data structures in c++
@kunalsakhare7538
@kunalsakhare7538 5 жыл бұрын
In program I got a error - Void addValue function is showing error saying - reference to Distance is ambitious.
@SumantKumar-jn9fm
@SumantKumar-jn9fm 4 жыл бұрын
Ambiguous*
@harshjoshi4539
@harshjoshi4539 4 жыл бұрын
same here did you get solution
@thefive.am.c
@thefive.am.c 2 жыл бұрын
isn't the friend function declared inside the class , sir ??
@patjiyane6906
@patjiyane6906 6 жыл бұрын
Can a friend function declaration prototype be declared with no return type? friend Rectangle duplicate (Rectangle & rect1, Rectangle & rect2); duplicate (foo, bar);
@RahulCarpenter
@RahulCarpenter 6 жыл бұрын
great bro!! Keep Uploading🙌🙌
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much brother 😇 I would request you to please share the video with your friends and contacts 😇
@RahulCarpenter
@RahulCarpenter 6 жыл бұрын
​@@SimpleSnippets definitely bro!!
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much bro 👍
@BushraFatima-w3e
@BushraFatima-w3e 4 ай бұрын
I am facing an error when i compile and run the code i.e reference to 'distance' is ambiguous
@GameingYKSipa
@GameingYKSipa 5 жыл бұрын
I loved ur explanation ❣️
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you so much bro, Please do share the videos with your friends too bro. That will be the biggest help & support 😇
@Selva-bx9iy
@Selva-bx9iy 4 жыл бұрын
Ur amazing bro❤
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thank you so much Selva. Glad to hear this from you. :-) Please do share the videos with your friends too & hope you have subscribed. Thats the biggest help and support you can provide :-)
@saugatthapa6295
@saugatthapa6295 5 жыл бұрын
#include using namespace std; class distance{ private: int meter; public: distance(){ meter = 0; } void disp(){ cout
@adarshtodi1158
@adarshtodi1158 5 жыл бұрын
@muhammed sahad ibn abdul samad same problem.. found any solution?
@akashshaw1594
@akashshaw1594 5 жыл бұрын
Change your class name to Distance or something else bcoz your current class name 'distance' is clashing with another symbol from namespace
@G__BagulSamruddhi
@G__BagulSamruddhi 3 жыл бұрын
@@akashshaw1594 thank you sm! this helped!!:)
@Durgasivakumaran
@Durgasivakumaran 3 жыл бұрын
😍all videos👌
@sandrokan89
@sandrokan89 6 жыл бұрын
One thing does not make sense to me, and that's something I've seen being done in every "friend function tutorial"... WHY do you put the friend function in the public section of the class? Isn't that redundant, as a public function can be accessed "publicly" (just like the 'get' and 'set' methods)?? Would the code still work if you were to put the public function in the private section?
@cosmicgyan6732
@cosmicgyan6732 4 жыл бұрын
We need to access private data of a class that's why
@mohammedzayedkhan9685
@mohammedzayedkhan9685 2 жыл бұрын
Friend is declared inside the class
@anushkaaggarwal2972
@anushkaaggarwal2972 4 жыл бұрын
i am having an error. when i defined the addvalue function, it showed that reference to distance is ambiguous. please help
@hypermeero4782
@hypermeero4782 4 жыл бұрын
me too try this out , it will work tho.. #include using namespace std; class test{ private: int data1,data2; public: test(); //Default Constructor test(int a , int b){ //Parameterised Constructor which is Constructor with arguements data1 = a; data2 = b; } void display(); friend void multiply(test); //Friend Function (doesnt matter where you initialize it) }; //End of class void test::display(){ cout
@ashishkatyal
@ashishkatyal 4 жыл бұрын
Make the first letter of the class name capital
@paramgill2712
@paramgill2712 4 жыл бұрын
@@ashishkatyal it worked thankks, but can u explain why so?
@ashishkatyal
@ashishkatyal 4 жыл бұрын
@@paramgill2712 I'm glad it helped. You can declare it with lower case, but it may not work in some compilers as the convention is to start with a capital letter. The conventions were created to make it easier on others to read and understand your code.
@kunalagarwal4473
@kunalagarwal4473 4 жыл бұрын
@@ashishkatyal thanks buddy it worked :-)
@lotsoflols6822
@lotsoflols6822 5 жыл бұрын
Keep it up👍
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you so much, please do subscribe and share the video with your friends too. Thats the biggest help and suport you can provide in return😇
@sponge8697
@sponge8697 5 жыл бұрын
Hi. Do u need to pass the ostream “cout ” to displayData function in your class?
@okkhot479
@okkhot479 4 жыл бұрын
Which software u have used for code
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Dev C++
@hamzajlassi2845
@hamzajlassi2845 4 жыл бұрын
like the intro bro
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thats great to hear buddy, Please do subscribe and share our channel with your friends too! Thats the biggest help and support 😇
@divijsamuel7229
@divijsamuel7229 4 жыл бұрын
cant we name the constructors with a name different than the class??
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Nope✌
@syedimadhaqqi4340
@syedimadhaqqi4340 5 жыл бұрын
Good lecture. I am getting an error when I implement your program. It is: error: 'int Distance::meters' is private. What does this mean. I cannot run the program. Also, I have to use #include and getch() to see a result, otherwise the output screen pop up and vanishes. Does not stay like your output screen. Do you know how I can get a output without this. My program is written below: Thanks #include #include using namespace std; class Distance { private: int meters; public: Distance() { meters=0; } void displayData() { cout
@internetzz2322
@internetzz2322 5 жыл бұрын
Change the return type from void to int , for the friend function it should work
@syedimadhaqqi4340
@syedimadhaqqi4340 5 жыл бұрын
@@internetzz2322 Still same problem
@_ARITRIKABISWAS
@_ARITRIKABISWAS 3 жыл бұрын
Thank you
@farahhamid360
@farahhamid360 4 жыл бұрын
Plz upload a video about dynamic variables (pointers) 🥺🥺🥺
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
I already have that in this C++ programming playlist. Do check it out :-)
@sirisagar3606
@sirisagar3606 4 жыл бұрын
bro can you clear my doubt- what is function of cpp
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
I have a video on this topic too!
@sirisagar3606
@sirisagar3606 4 жыл бұрын
@@SimpleSnippets ok😊
@Blooderstokizz
@Blooderstokizz 4 жыл бұрын
Best indian guy ever
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Haha thanks buddy, highly obliged to have such a title ❤😇
@allareintomyworldofinventi3117
@allareintomyworldofinventi3117 3 жыл бұрын
what are you studying now bro
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
The next topic that I have to make video on 😜 (Data structures and algos basically)
@sabahatfaria168
@sabahatfaria168 6 жыл бұрын
Plz explain a bit about friend classes as well i hope i can make a request after all there is a specific quota for "ON DEMAND VIDEOS"😊🤗
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Definitely, I'll create one video on this topic for sure 😇 And yes there is always an on demand option for all of viewers and subscribers 😇✌️
@sabahatfaria168
@sabahatfaria168 6 жыл бұрын
Thnx for ur attention on my small request🤗🤗
@sabahatfaria168
@sabahatfaria168 6 жыл бұрын
Kindly try to make my requested video before 16 may after all i need your help for my exam🙂🙂
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
I will try to post this video by day after tomorrow 😇✌️
@sabahatfaria168
@sabahatfaria168 6 жыл бұрын
Thnx alot once again working like that will definitely make one to pray for u😊😊
@NormieMob
@NormieMob 5 жыл бұрын
Good video
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you :-)
@armv7-m603
@armv7-m603 6 жыл бұрын
Thanks
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
You're always welcome. Do share the videos with your friends and contacts :-)
@nashhash4625
@nashhash4625 6 жыл бұрын
cout
@sudharsanbalasubramaniyan3761
@sudharsanbalasubramaniyan3761 4 жыл бұрын
Super bro
@ismailbajrami7478
@ismailbajrami7478 4 жыл бұрын
how this program runs in the line 12 the variable name is meter but in the privat its meters ? i expected and error but ok
@Omarismail-vs4jl
@Omarismail-vs4jl 4 жыл бұрын
I guess you werent watching the video
@Nikhil-yi3qc
@Nikhil-yi3qc 4 жыл бұрын
Which IDE are you using?
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Dev C++ IDE
@BringMe_Back
@BringMe_Back 3 жыл бұрын
Nice 🤤, thanks
@bhairavaswami7897
@bhairavaswami7897 5 жыл бұрын
Sir please explain slowly,we canot move with your speed
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Agreed, I will make sure to go slow in future. Sorry for the inconvenience
@Goat-gamerzz
@Goat-gamerzz 4 жыл бұрын
i think your speed is pretty good , i watch your vids at 1.8 speed
@himanigulati6922
@himanigulati6922 4 жыл бұрын
i am gettin so many errors. although i have written the exact same code!
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Well in the video things worked out without errors isnt it ? So IDK how come you are getting so many errors 😅 Check the video description for the full code and cross check it again maybe ✌
@himanigulati6922
@himanigulati6922 4 жыл бұрын
@@SimpleSnippets can i send you the error its showing somewhere else?
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
@@himanigulati6922 I don't debug others code so don't expect me to solve your queries and errors, but still you can DM me via our Instagram page - instagram.com/simplesnippets Or mail me at - simplesnippetsinfo@gmail.com
@abdullahawanz_278
@abdullahawanz_278 3 жыл бұрын
Love from pakistan🖤
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thanks buddy, I'm glad to hear this. Please do share the videos with your friends too. That's the biggest help and support you can give back to me 🙏😊
@amannagar1108
@amannagar1108 5 жыл бұрын
U r top good
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thanks Aman😊 glad to hear this feedback bro ✌️
@ashwiniuppin5007
@ashwiniuppin5007 6 жыл бұрын
Sir what is your qualification ????☺
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
I completed my post grad - masters in computer applications a year back! MCA ✌️ Although I don't think qualifications matter 😛
@turdle69420
@turdle69420 5 жыл бұрын
"nice intro" - no one
@onezaalvi9866
@onezaalvi9866 4 жыл бұрын
levellllllllllllllllllll
@vineetjindal6582
@vineetjindal6582 3 жыл бұрын
explain in Hindi also
@Kennerdoll
@Kennerdoll 3 жыл бұрын
bro take it easy data you have but you are too fast
@venkateshojha5520
@venkateshojha5520 4 жыл бұрын
It will be greatful if u a create watsapp grp
@ArvindLohar-h2k
@ArvindLohar-h2k Жыл бұрын
very poor explanation first get advanced and learn how to use vs code.
@oldschoolgamer6941
@oldschoolgamer6941 4 жыл бұрын
thanks
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Welcome
@gouravmajee9913
@gouravmajee9913 3 жыл бұрын
thank you
Operator Overloading in C++ Programming | C++ Programming for Beginners
13:32
Friend Class in C++ Programming with Program Example & Explanation
8:38
Friend Functions | C++ Tutorial
13:05
Portfolio Courses
Рет қаралды 10 М.
15 Years Writing C++ - Advice for new programmers
4:04
SyncMain
Рет қаралды 1,3 МЛН
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,3 МЛН
Friend Function in C++ | C++ Programming | In Hindi
17:29
codeitup
Рет қаралды 148 М.
Object Oriented Programming in C++ for beginners | Introduction
18:33
Simple Snippets
Рет қаралды 249 М.
Friend functions and classes in C++ (Programming for beginners)
18:18
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 951 М.
Virtual Functions & Abstract Classes in C++ | C++ Programming Tutorials
15:12