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

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 98

  • @SimpleSnippets
    @SimpleSnippets  5 ปีที่แล้ว +10

    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

  • @shahrahul5872
    @shahrahul5872 5 ปีที่แล้ว +44

    No understanding in college...full understanding in ur video !

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว +4

      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 3 ปีที่แล้ว +1

      LoL same case with me

  • @dustinlim184
    @dustinlim184 2 ปีที่แล้ว +12

    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!

  • @wizard.01
    @wizard.01 11 หลายเดือนก่อน +1

    You deserve a million subscribers!!! you explained me the concepts which my college faculty could not.

  • @yourbestie4138
    @yourbestie4138 4 ปีที่แล้ว +10

    this man is making us atma nirbar

  • @kakarrot7998
    @kakarrot7998 ปีที่แล้ว +1

    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✨

  • @AjhayAK-Positivity-Only
    @AjhayAK-Positivity-Only 4 ปีที่แล้ว +7

    U deserve Million Subscribers💫❤

    • @SimpleSnippets
      @SimpleSnippets  4 ปีที่แล้ว +2

      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 😇

  • @shrishti779
    @shrishti779 4 ปีที่แล้ว +24

    2:50 AM.. U SERIOUS MAN!!! 😂🍁

    • @SimpleSnippets
      @SimpleSnippets  4 ปีที่แล้ว +12

      Hahahaha, I'm a night owl 😂 Also my voice sounds like I have cough and cold in this video 😅

    • @shrishti779
      @shrishti779 4 ปีที่แล้ว +3

      @@SimpleSnippets 😂😂

  • @m.reshma6428
    @m.reshma6428 2 ปีที่แล้ว +1

    Ur explains is Vera level sir

  • @sanjayr3503
    @sanjayr3503 4 ปีที่แล้ว +3

    It's also worked fine if we declare return type as int instead of weight, It is right to do like that.

  • @realpriyanshu02
    @realpriyanshu02 ปีที่แล้ว +1

    thank you for this great explanation with a simple and intelligible example.

  • @Mr_Dilo
    @Mr_Dilo 5 ปีที่แล้ว +3

    Thanks,I am very confused on pre and post increment but now it is clear,thanks again

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว +1

      Most welcome bro 😊 I would request you to please share it with your friends too ✌️

    • @AmanSharma-ko4vs
      @AmanSharma-ko4vs 4 ปีที่แล้ว +1

      All code are wrong

  • @eshantdas5252
    @eshantdas5252 3 ปีที่แล้ว +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 ปีที่แล้ว +1

    Thank you sir for such a stunning explanation.

  • @n1chip
    @n1chip 2 ปีที่แล้ว

    Thank You Simple Snippets ❤❤

  • @jamesnash9675
    @jamesnash9675 2 ปีที่แล้ว

    you are the best ........masum

  • @worldfacts6112
    @worldfacts6112 3 ปีที่แล้ว

    you are a good teacher and keep it up the good work

  • @SM-eh6vz
    @SM-eh6vz 3 ปีที่แล้ว +1

    Thanks a lot,well explained .....👍👍👍👍 thanks for your efforts.....🔥🔥🔥🔥

  • @parsishashank
    @parsishashank 5 ปีที่แล้ว +2

    Excellent..worked for me

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว +1

      Thank you so much buddy 😊 really happy to hear this from you ✌️

  • @parmeetsingh2075
    @parmeetsingh2075 5 ปีที่แล้ว +1

    you explain very well 👍👍

  • @divyanshikushwaha9707
    @divyanshikushwaha9707 3 ปีที่แล้ว

    very nice and informative

  • @divyanshikushwaha9707
    @divyanshikushwaha9707 3 ปีที่แล้ว

    doubts are clear

  • @tadalaneelima4979
    @tadalaneelima4979 5 หลายเดือนก่อน

    Thank you so much bro❤

  • @hope-jh7bv
    @hope-jh7bv 3 ปีที่แล้ว

    Thank you so much sir.

  • @kanchabeni6743
    @kanchabeni6743 4 ปีที่แล้ว +6

    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 😇

  • @izharkhankhattak
    @izharkhankhattak 3 ปีที่แล้ว +1

    Nice lecture

    • @SimpleSnippets
      @SimpleSnippets  3 ปีที่แล้ว +1

      Keep watching

    • @izharkhankhattak
      @izharkhankhattak 3 ปีที่แล้ว +1

      @@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.

  • @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.

  • @maitreyshukla258
    @maitreyshukla258 3 ปีที่แล้ว +1

    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! 😇

  • @kamyagupta4030
    @kamyagupta4030 2 ปีที่แล้ว

    Thank you soo much!!

  • @harikrishnanpr7824
    @harikrishnanpr7824 6 ปีที่แล้ว +1

    Great videos.

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว

      Thank you so much buddy 😇✌️ I would request you to please share the videos with your friends too 😇✌️

  • @kiranharish4471
    @kiranharish4471 6 ปีที่แล้ว +1

    you are rocking!

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว

      Thank you so much Kiran! Really happy to hear this from you 😇

  • @prashantdeuja9395
    @prashantdeuja9395 3 ปีที่แล้ว +1

    Kya Bhai ..yl...
    Raat me Sona chaiihye
    ...
    Anyways video is good for everyone ✋👊

  • @sumanthchakravarthi6853
    @sumanthchakravarthi6853 4 ปีที่แล้ว +6

    Can you please tell me why ++() for pre increment &&for post increment ++(int) in overloaded function???

    • @02lavanyaboddepalli18
      @02lavanyaboddepalli18 3 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@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

  • @yashgoyal3636
    @yashgoyal3636 4 ปีที่แล้ว +1

    Sir, how to know that where we should keep ++ before obj and ++ after obj ?

  • @satishsharma-rb8bj
    @satishsharma-rb8bj 6 ปีที่แล้ว +4

    Bro full 11 and 12 class C++course dheere dheere upload krdo
    Do not miss not atleast one videos

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว +2

      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 6 ปีที่แล้ว +2

      Bro 11 mei to aap function,Array,Structures hn

    • @satishsharma-rb8bj
      @satishsharma-rb8bj 6 ปีที่แล้ว

      I don't know about the class 12

    • @satishsharma-rb8bj
      @satishsharma-rb8bj 6 ปีที่แล้ว +2

      You plz give me ur cntact nmber..

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว

      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 - th-cam.com/video/AKNGgAXTark/w-d-xo.html
      Do share the videos with your friends and contacts and keep sharing the knowledge ✌✌

  • @krishaelle8309
    @krishaelle8309 2 ปีที่แล้ว

    thanks

  • @lokanathanganesan6070
    @lokanathanganesan6070 3 ปีที่แล้ว

    Thank you sir.Thr lecture was nice

  • @thefive.am.c
    @thefive.am.c 2 ปีที่แล้ว +1

    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...

  • @surendrabhusal3626
    @surendrabhusal3626 5 ปีที่แล้ว +2

    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

  • @shahrahul5872
    @shahrahul5872 5 ปีที่แล้ว +2

    Bauuu good

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว

      Thanks buddy ✌️😊
      Please share with your friends too ✌️

  • @arshmaanali714
    @arshmaanali714 3 ปีที่แล้ว

    Sir please make more tutorials on C++ oop

  • @anjusosa8150
    @anjusosa8150 3 ปีที่แล้ว

    Can you explain binary operator overloading

  • @nidhinhari8397
    @nidhinhari8397 5 ปีที่แล้ว +1

    Please explain operator overloading using friend function

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว +2

      i'll try to cover this topic soon 😇

    • @SimpleSnippets
      @SimpleSnippets  5 ปีที่แล้ว +1

      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 😊

  • @nirajmalik0910
    @nirajmalik0910 ปีที่แล้ว

    It's running even without return temp 🧐

  • @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

  • @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!!

  • @dee_pak2365
    @dee_pak2365 6 ปีที่แล้ว +1

    How to download.. Code block..
    And how to install. Plz this topic make a video

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว

      +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 TH-cam it topic and I'm sure you'll get some results.

    • @dee_pak2365
      @dee_pak2365 6 ปีที่แล้ว +1

      Simple Snippets
      Thank you

    • @bommanaboyinahimabindu339
      @bommanaboyinahimabindu339 6 ปีที่แล้ว +1

      DSP DEEPAK
      You can easily download it through chrome webstore . Installation is also easy .

  • @telephonedude04
    @telephonedude04 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      just do kg+1 instead of ++kg

    • @garou0827
      @garou0827 2 ปีที่แล้ว

      But y does increase itself

  • @kaushangsurya
    @kaushangsurya 2 ปีที่แล้ว

    👍👍👍👍👍

  • @akshithtalks179
    @akshithtalks179 6 ปีที่แล้ว +1

    I not got from 10:30 to 11:30

    • @SimpleSnippets
      @SimpleSnippets  6 ปีที่แล้ว +3

      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. :-)

  • @sujatha_vocals
    @sujatha_vocals 3 ปีที่แล้ว +1

    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 ปีที่แล้ว

    thank you so much 💗