Increment & Decrement Operator Overloading in C++ | Unary Operator Overloading Program Example

  Рет қаралды 95,171

Simple Snippets

Simple Snippets

Күн бұрын

Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
--------------------------------------------------------------------------------------------- In this C++ programming video tutorial with will perform increment and decrement operator overloading. We will overload both pre and post increment and decrement operators and will see example c++ program.
Operator Oveloading in C++
C++ allows you to specify more than one definition for an operator in the same scope, which is called operator overloading.
You can redefine or overload most of the built-in operators available in C++
It is a type of polymorphism in which an operator is overloaded to give user defined meaning to it.
Almost any operator can be overloaded in C++. However there are few operator which can not be overloaded. Operator that are not overloaded are follows-
scope operator (::)
sizeof
member selector -(.)
member pointer selector - (*)
ternary operator - (?:)
Unary Operator Overloading in C++ Theory Article - simplesnippets...
Download Dev C++ IDE : sourceforge.ne....
Download C++ Android App : play.google.co...
Simple Snippets Official Website -
simplesnippets...
Simple Snippets on Facebook-
/ simplesnippets
Simple Snippets on Instagram-
/ simplesnipp. .
Simple Snippets Google Plus Page-
plus.google.co...
Simple Snippets email ID-
simplesnippetsinfo@gmail.com
For Classroom Coaching in Mumbai for Programming & other IT/CS Subjects Checkout UpSkill Infotech - upskill.tech/
UpSkill is an Ed-Tech Company / Coaching Centre for Information Technology / Computer Science oriented courses and offer coacing for various Degree courses like BSc.IT, BSc.CS, BCA, MSc.IT, MSc.CS, MCA etc.
Contact via email /call / FB /Whatsapp for more info
email - upskillinfotech@gmail.com
We also Provide Certification courses like -
Android Development
Web Development
Java Developer Course
.NET Developer Course
Check us out on Social media platforms like Facebook, Instagram, Google etc
Facebook page - / upskillinfotech
Insta page - / upskill_infotech
Google Maps - goo.gl/maps/vj...
Intro Music by - DSTNCT MUSIC
DSTNCT MUSIC FB page - / dstnctmusic
DSTNCT MUSIC KZbin Channel - / @dstnct5838

Пікірлер: 102
@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 ✌
@husnainali076c7
@husnainali076c7 3 жыл бұрын
share code in description as behind very video
@dustinlim184
@dustinlim184 2 жыл бұрын
Wish I looked this up first last night before i spent 4 unsuccessful hours trying to get my code to work. Makes so much more sense now compared to the text book! Thanks for what you do!
@shahrahul5872
@shahrahul5872 6 жыл бұрын
No understanding in college...full understanding in ur video !
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thanks Rahul. Glad to hear this from you and happy to help always 😇 Please keep up the support by sharing the video :-)
@parmeetsingh2075
@parmeetsingh2075 5 жыл бұрын
agreed i have the same case
@smackedup7657
@smackedup7657 4 жыл бұрын
LoL same case with me
@Youth.Computer
@Youth.Computer Ай бұрын
Well said.
@wizard.01
@wizard.01 Жыл бұрын
You deserve a million subscribers!!! you explained me the concepts which my college faculty could not.
@yourbestie4138
@yourbestie4138 4 жыл бұрын
this man is making us atma nirbar
@shrishti779
@shrishti779 4 жыл бұрын
2:50 AM.. U SERIOUS MAN!!! 😂🍁
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Hahahaha, I'm a night owl 😂 Also my voice sounds like I have cough and cold in this video 😅
@shrishti779
@shrishti779 4 жыл бұрын
@@SimpleSnippets 😂😂
@kakarrot7998
@kakarrot7998 Жыл бұрын
Thank u so much Sir ....I didn't had any idea about Operator Overloading but now as I've watched both videos.. I've a lot...Boht Shukriya✨
@SimpleSnippets
@SimpleSnippets Жыл бұрын
Happy to know this 😊
@Youth.Computer
@Youth.Computer Ай бұрын
Very good which show the use of unary operator with objects
@m.reshma6428
@m.reshma6428 2 жыл бұрын
Ur explains is Vera level sir
@Mr_Dilo
@Mr_Dilo 5 жыл бұрын
Thanks,I am very confused on pre and post increment but now it is clear,thanks again
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Most welcome bro 😊 I would request you to please share it with your friends too ✌️
@AmanSharma-ko4vs
@AmanSharma-ko4vs 4 жыл бұрын
All code are wrong
@AjhayAK-Positivity-Only
@AjhayAK-Positivity-Only 4 жыл бұрын
U deserve Million Subscribers💫❤
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thank you so much bro. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@sanjayr3503
@sanjayr3503 4 жыл бұрын
It's also worked fine if we declare return type as int instead of weight, It is right to do like that.
@realpriyanshu02
@realpriyanshu02 2 жыл бұрын
thank you for this great explanation with a simple and intelligible example.
@SimpleSnippets
@SimpleSnippets 2 жыл бұрын
You're very welcome!
@devendraonly239
@devendraonly239 2 ай бұрын
6 year ago , great video
@jamesnash9675
@jamesnash9675 2 жыл бұрын
you are the best ........masum
@eshantdas5252
@eshantdas5252 3 жыл бұрын
Thank u so much sir I wish my university teachers would explain like u
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
So nice of you. Thanks bro, please do share the videos & our channel with your friends too. Thats the biggest help and support you can give back to this channel! 😇
@tabassumhafsa4704
@tabassumhafsa4704 2 жыл бұрын
Thank you sir for such a stunning explanation.
@SM-eh6vz
@SM-eh6vz 4 жыл бұрын
Thanks a lot,well explained .....👍👍👍👍 thanks for your efforts.....🔥🔥🔥🔥
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Glad you liked it
@tadalaneelima4979
@tadalaneelima4979 7 ай бұрын
Thank you so much bro❤
@n1chip
@n1chip 2 жыл бұрын
Thank You Simple Snippets ❤❤
@parsishashank
@parsishashank 6 жыл бұрын
Excellent..worked for me
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much buddy 😊 really happy to hear this from you ✌️
@PakeezaAsghar-q3p
@PakeezaAsghar-q3p Ай бұрын
Thank you soo much
@parmeetsingh2075
@parmeetsingh2075 5 жыл бұрын
you explain very well 👍👍
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thanks man 😇
@worldfacts6112
@worldfacts6112 3 жыл бұрын
you are a good teacher and keep it up the good work
@divyanshikushwaha9707
@divyanshikushwaha9707 3 жыл бұрын
very nice and informative
@divyanshikushwaha9707
@divyanshikushwaha9707 3 жыл бұрын
doubts are clear
@hope-jh7bv
@hope-jh7bv 3 жыл бұрын
Thank you so much sir.
@izharkhankhattak
@izharkhankhattak 4 жыл бұрын
Nice lecture
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Keep watching
@izharkhankhattak
@izharkhankhattak 4 жыл бұрын
@@SimpleSnippetsYes, bro it's really helping me. Thanks for being so kind. By the way, I am from Pakistan. A truck full of kindness, love to you. I wish to have a very nice relationship between our countries and no problem with visiting each other countries. Keep repeating the word peace at the end of the lecture.
@kamyagupta4030
@kamyagupta4030 2 жыл бұрын
Thank you soo much!!
@maitreyshukla258
@maitreyshukla258 3 жыл бұрын
simply awsm
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thank you, please do share the videos & our channel with your friends too. Thats the biggest help and support you can give back to this channel! 😇
@kanchabeni6743
@kanchabeni6743 4 жыл бұрын
bruh my professor and u sound same but somehow i understand yo video.
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Maybe you dont pay attention in class 😜😂. Kidding. Anyways thank you so much buddy. Please do share our channel with your friends too. Thats the biggest help and support you can provide 😇
@krishaelle8309
@krishaelle8309 3 жыл бұрын
thanks
@sumanthchakravarthi6853
@sumanthchakravarthi6853 4 жыл бұрын
Can you please tell me why ++() for pre increment &&for post increment ++(int) in overloaded function???
@02lavanyaboddepalli18
@02lavanyaboddepalli18 3 жыл бұрын
@sumanth chakravarthi that was done just inorder to differentiate it with the prev function if u want u can also use it like this....++(int) for pre inc and ++() for post inc...that doesn't matter if u dont show difference between two functions then the compiler gets confused ...which function to call ..and hence it throws an error...so in order to avoid this he used like that..
@learncseasily3385
@learncseasily3385 3 жыл бұрын
@@02lavanyaboddepalli18 bro if we keep (int) Then in the main fuctn if we call like ++Obj; still it throw error It excepts to have obj++ instead of ++obj
@kiranharish4471
@kiranharish4471 6 жыл бұрын
you are rocking!
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much Kiran! Really happy to hear this from you 😇
@yashgoyal3636
@yashgoyal3636 4 жыл бұрын
Sir, how to know that where we should keep ++ before obj and ++ after obj ?
@surendrabhusal3626
@surendrabhusal3626 5 жыл бұрын
Why is both pre and post increment functioning similarly when operator function is void. ?? But at the end, it is functioning alright when return type is Weight.
@samwillson9021
@samwillson9021 4 жыл бұрын
i guess when we are storing an object in another object we are storing and then using it so the change is on the rhs not on the lhs but when we are just incrementing an object without storing it only displays the incremented value
@harikrishnanpr7824
@harikrishnanpr7824 6 жыл бұрын
Great videos.
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much buddy 😇✌️ I would request you to please share the videos with your friends too 😇✌️
@prashantdeuja9395
@prashantdeuja9395 3 жыл бұрын
Kya Bhai ..yl... Raat me Sona chaiihye ... Anyways video is good for everyone ✋👊
@onlysisir
@onlysisir 2 жыл бұрын
Sir....is it necessary to make parameterized constructor Weight (int x) ? Coz my worked fine without it
@kakarrot7998
@kakarrot7998 Жыл бұрын
Not Necessary...bcz that was not even used in this program...
@VipinKumar-us1sr
@VipinKumar-us1sr 3 жыл бұрын
You should not be using another temp object. It can be done without using too. Hence less memory will be used.
@shahrahul5872
@shahrahul5872 6 жыл бұрын
Bauuu good
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thanks buddy ✌️😊 Please share with your friends too ✌️
@satishsharma-rb8bj
@satishsharma-rb8bj 7 жыл бұрын
Bro full 11 and 12 class C++course dheere dheere upload krdo Do not miss not atleast one videos
@SimpleSnippets
@SimpleSnippets 7 жыл бұрын
Hello Satish, sure I will try to cover all the topics for 11th and 12th. Also it will be very helpful if you can share the latest syllabus copy for C++ subject for class 11th and 12th so that I can check what all topics are still left and try to cover those. Please do share these videos with your friends and contacts so that even they get the knowledge 😇
@satishsharma-rb8bj
@satishsharma-rb8bj 7 жыл бұрын
Bro 11 mei to aap function,Array,Structures hn
@satishsharma-rb8bj
@satishsharma-rb8bj 7 жыл бұрын
I don't know about the class 12
@satishsharma-rb8bj
@satishsharma-rb8bj 7 жыл бұрын
You plz give me ur cntact nmber..
@SimpleSnippets
@SimpleSnippets 7 жыл бұрын
Hi Satish, I have covered functions, arrays structures and many more topics in the full C++ playlist, you can check that out on my channel or here's the link - kzbin.info/www/bejne/d3yxeJp3jbmUqM0 Do share the videos with your friends and contacts and keep sharing the knowledge ✌✌
@bharatgoyal6459
@bharatgoyal6459 3 жыл бұрын
why we didn't write program of copy constructor, nd how it work without copy constructor, since we are increasing value of kg for temp object thats fine, but without implementing copy constructor how it copy data from one obj. to another!!
@DeepakKumar-fd4qu
@DeepakKumar-fd4qu 5 жыл бұрын
why you used int type of argument for postfix .....? what was the use of that argument ......? and why psotfix is not work without int type arugument......?Please sir reply...?
@02lavanyaboddepalli18
@02lavanyaboddepalli18 3 жыл бұрын
that was done just inorder to differentiate it with the prev function if u want u can also use it like this....++(int) for pre inc and ++() for post inc...that doesn't matter if u dont show difference between two functions then the compiler gets confused ...which function to call ..and hence it throws an error...so in order to avoid this he used like that.. @Deepak Kumar
@lokanathanganesan6070
@lokanathanganesan6070 3 жыл бұрын
Thank you sir.Thr lecture was nice
@nidhinhari8397
@nidhinhari8397 5 жыл бұрын
Please explain operator overloading using friend function
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
i'll try to cover this topic soon 😇
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Also nice username. Any chance there's another Dark Knight movie coming ? 😜 #justkidding
@nidhinhari8397
@nidhinhari8397 5 жыл бұрын
😂
@nidhinhari8397
@nidhinhari8397 5 жыл бұрын
Sir iam Nidhin Hari. From Kerala
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Hi buddy, I'm Tanmay Sakpal from Mumbai 😊
@anjusosa8150
@anjusosa8150 3 жыл бұрын
Can you explain binary operator overloading
@arshmaanali714
@arshmaanali714 3 жыл бұрын
Sir please make more tutorials on C++ oop
@akshithtalks179
@akshithtalks179 6 жыл бұрын
I not got from 10:30 to 11:30
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
we cannot use int because on the LHS of the = sign we have a Object of weight type so to match that, the function also should return an object of the same type. Hope you get it. :-)
@dee_pak2365
@dee_pak2365 7 жыл бұрын
How to download.. Code block.. And how to install. Plz this topic make a video
@SimpleSnippets
@SimpleSnippets 7 жыл бұрын
+DSP DEEPAK hello, just do to the link that I've shared in the video description and download the installer file. The installation is very easy, it's basically just next next next and follow the default options. If you still have issues you can Google or KZbin it topic and I'm sure you'll get some results.
@dee_pak2365
@dee_pak2365 7 жыл бұрын
Simple Snippets Thank you
@bommanaboyinahimabindu339
@bommanaboyinahimabindu339 6 жыл бұрын
DSP DEEPAK You can easily download it through chrome webstore . Installation is also easy .
@kaushangsurya
@kaushangsurya 2 жыл бұрын
👍👍👍👍👍
@nirajmalik0910
@nirajmalik0910 2 жыл бұрын
It's running even without return temp 🧐
@telephonedude04
@telephonedude04 4 жыл бұрын
I think the problem with this is that when you call "obj2 = ++obj1", obj1 gets affected as well. Unlike when you type in "x = ++y", y does not get affected. Not sure how to get around that though.
@AmanSharma-lg5lt
@AmanSharma-lg5lt 4 жыл бұрын
just do kg+1 instead of ++kg
@garou0827
@garou0827 2 жыл бұрын
But y does increase itself
@sujatha_vocals
@sujatha_vocals 3 жыл бұрын
please speak a bit slow i think most of the viewers like me are not able to follow the flow
@amansinghal4663
@amansinghal4663 3 жыл бұрын
peace
@kamyagupta4030
@kamyagupta4030 2 жыл бұрын
thank you so much 💗
Function Templates in C++ with Program Example | C++ Programmming
11:49
Simple Snippets
Рет қаралды 103 М.
Function Overloading in C++ Programming
10:02
Simple Snippets
Рет қаралды 178 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Operator Overloading in C++ Programming | C++ Programming for Beginners
13:32
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 1 МЛН
Overloading Unary Operator in C++ | C++ Tutorial | Mr. Kishore
14:39
Naresh i Technologies
Рет қаралды 70 М.
Pass by Value | Pass by Reference | Pass by Address in C++ Programming
19:14
Всё об указателях в C++ за 20 минут
20:00
Operator Overloading In C++
13:50
CppNuts
Рет қаралды 58 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН