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

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

Комментарии • 99

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

  • @dustinlim184
    @dustinlim184 2 года назад +13

    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 5 лет назад +45

    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

  • @wizard.01
    @wizard.01 Год назад +2

    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

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

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

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

  • @m.reshma6428
    @m.reshma6428 2 года назад +1

    Ur explains is Vera level sir

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

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

  • @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 2 года назад +1

    Thank you sir for such a stunning explanation.

  • @devendraonly239
    @devendraonly239 День назад +1

    6 year ago , great video

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

    Thank You Simple Snippets ❤❤

  • @parsishashank
    @parsishashank 5 лет назад +2

    Excellent..worked for me

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад +1

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

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

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

  • @SM-eh6vz
    @SM-eh6vz 3 года назад +1

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

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

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

  • @parmeetsingh2075
    @parmeetsingh2075 5 лет назад +1

    you explain very well 👍👍

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

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

    very nice and informative

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

  • @tadalaneelima4979
    @tadalaneelima4979 5 месяцев назад

    Thank you so much bro❤

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

    doubts are clear

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

  • @hope-jh7bv
    @hope-jh7bv 3 года назад

    Thank you so much sir.

  • @kiranharish4471
    @kiranharish4471 6 лет назад +1

    you are rocking!

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

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

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

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

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

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

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

    Nice lecture

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

      Keep watching

    • @izharkhankhattak
      @izharkhankhattak 4 года назад +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.

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

    Thank you soo much!!

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

  • @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 😇✌️

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

    Thank you sir.Thr lecture was nice

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

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

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

    thanks

  • @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 - ruclips.net/video/AKNGgAXTark/видео.html
      Do share the videos with your friends and contacts and keep sharing the knowledge ✌✌

  • @shahrahul5872
    @shahrahul5872 5 лет назад +2

    Bauuu good

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

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

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

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

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

    Can you explain binary operator overloading

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

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

    Sir please make more tutorials on C++ oop

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

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

    It's running even without return temp 🧐

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

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

    peace

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

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

    thank you so much 💗