Function Templates in C++ with Program Example | C++ Programmming

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

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

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

    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 ✌

    • @dinesh.p8642
      @dinesh.p8642 5 ปีที่แล้ว +2

      brother,,U deserve more subscribers,,and publicity,,i will do my part to achieve it,,thanks for ur free quality content and i am very much confident in c++ programming only because of ur content...once again thank you somuch brother..
      P.Dinesh

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

      Hey Dinesh, thank you so much bro for such a wonderful comment & your support is the biggest help for the channel 😊 I'm glad to hear this from you ✌️
      Also we just crossed 50K subs so stay tuned for the surprise 😉

    • @dinesh.p8642
      @dinesh.p8642 5 ปีที่แล้ว +2

      @@SimpleSnippets it's indeed a nice part of you in replying ur subscribers..coz it makes us feel good that we have some relationship with people like you.that makes the difference in getting knowledge brother..bye

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

      @@dinesh.p8642 yes bro, I value all my subscribers a lot & pretty much reply to all of them. Its because of all of your support that our channel has grown so much bro :-)

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

      Bhai tm c++ ka playlist Kyu Nhi banate mujhe sab topic dhund ke padhna padhta hai

  • @ramishmasood5782
    @ramishmasood5782 6 ปีที่แล้ว +57

    This channel is extremely underrated. Good job (y)

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

      Thank you so much Ramish for the compliments. And yeah I get that underrated comment quite often😥 IDK how to reach to more users. Please do share the content with your friends buddy, will be really helpful ✌️

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

      @@SimpleSnippets I am a uni student and I ask everyone who faces difficulty regarding anything, to visit your channel to see if their queries are solved. Keep up the good wor
      k.

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

      Thank you so much bro 😇✌️ this means a lot to me. Keep sharing and keep up the support ✌️

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

      Exactly!

  • @krishnsinghrajawat6813
    @krishnsinghrajawat6813 3 ปีที่แล้ว +8

    Every video, I watch, I will gonna say Tanmay Sakpal ki Jai 😅 I don't get tired watching your videos man what quality hats off..

  • @viveklamba3176
    @viveklamba3176 5 ปีที่แล้ว +7

    Wow ...its so catchy....the concept are on point.....he deserves more subscribers ...

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

      Thank you so much Vivek ♥️
      Hopefully with your support our channel will grow more 😊
      Do share the video with your friends too ✌️

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

    I guess if you even do not specify the it will work. Just have to mention two parameters of the same datatype.

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

    Yeah you need to be promoted sir, Hats off .

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

      Thank you buddy. Glad to hear this from you. please do share this videos and our channel with your friends too bro, thats the biggest help and support 😇

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

    Super. Very intuitive and catching. I will see all your videos

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

      That's amazing to know buddy 😊
      Very happy to hear this from you. Hope you like them all and if you do please share them with your friends too 😊✌️

  • @mahesh-jg3zx
    @mahesh-jg3zx 5 ปีที่แล้ว +2

    I'm seeing aLL the videos of c++,sir.
    but you are osm sir,
    You are giving the Best to the students

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

    Clearly understood from your stuff.Thank you so much Tanmay .Very thanks......

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

      Most welcome Purva 🤟 glad to hear this from you. I would request you to please share the videos with your friends too 😋

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

    u deserve way more views and subs..

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

      Thanks bro 😊. The only way this can happen is if you help by sharing the videos with your friends buddy 😊✌️

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

    Thank u so much, I understood very well. You explained it in such a perfect way

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

    Thanks for the informative videos , You are giving your best thanks for that also

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

      Thank you for the positive feedback buddy. Please do share the video with your friends and contacts as well. Thats the biggest help and support you can provide to all 😇✌

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

    Great content and im wasting thousands on this courses outside...this is very useful chanel i am learning c++ from your videos

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

      Thank you bro! No need to spend money on fundamentals. There are many resources now a days. Also do checkout my data structures and algorithms course also. You'll love it ✌️

  • @Deepak_Juluru
    @Deepak_Juluru 3 ปีที่แล้ว +2

    bro you are really awesome really

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

    ur all videos are juz fab ,hope so it will help mi in pracs exam

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

      That's really amazing to know Prajakta 😁 glad to hear this from you. Please do share this videos with your friends also & All the best for your exams ✌️

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

    Tanmay sir Op..!!!

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

    tomorrow is my sem exam and you helped a lot thankyou

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

      That's great to know bro. Please do share the video with your friend too 🤘

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

    Bro you helped me a lott tomorrow my PPT presentation is there
    Thanks for explaining in detail.... 🤗

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

    amazing video brother

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

    love you broooooooooooooooo......................, superrrrrrrrr

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

    Great concept explained very well!

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

      +Nikhiil Rajesh hello Nikhil, thank you so much for your positive feedback. Really happy to hear that you liked this video. Please do share the video with your friends and contacts and keep sharing the knowledge 😇✌️

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

    Simple English made me understand the concept
    Very nice vedio

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

      Thank you so much Kanchana. Glad to hear this feedback from you 😇 Please do share the videos with your friends too 😇

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

    Perfect and best content 👌thanks a lot brooooo💥💥💥

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

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

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

    this guy is amazing yall

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

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

    superb bro💟

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

      Thank you so much brother. Please do share the video with your friends ✌️😇

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

    Thank you sirr

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

    Very excellent explanation ...

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

    First liked, then watched

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

    seriously boss, that's two good

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

      Thanks bro 😊 I would request you to please share the video with your friends too ✌️ that'll be the best help ✌️

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

    Really appreciate that 😉

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

    Super helpful!

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

    Thanks for this amazing video.

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

    Sir your teaching method is very well but teach it slowly mean your speed is high Thank you

  • @bardia52
    @bardia52 6 หลายเดือนก่อน

    I finally learned function templates here, and I couldn't learn it by reading Stroustrup's book!
    One question: Is there any change to this in C++ 20?

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

    Luv u sir

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

    great video, precise explanation thanks a lot

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

    seriously man.! you are the best.!!! :))

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

      Most welcome my friend ♥😇 Your compliments & support means a lot. Please do share the video with our friends too✌

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

    Great video as always!

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

    This is the first time I have to actually slow down a TH-cam video.

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

    Simply awesome!!!

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

      Glad you liked it! Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

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

    Excellent!

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

    keep up the good work

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

      Thanks buddy! please do share the video and our channel with your friends too. Thats the biggest help and support 😇

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

    Thanku❤️🙏🏻

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

      Thank you so much buddy. It would mean a lot if you could please share our channel and videos with your friends too ✌

    • @Fuggaaaa
      @Fuggaaaa 4 ปีที่แล้ว

      @@SimpleSnippets yes...sure.... 😊😊🤗

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

    Very well explained ! Thanks :)

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

      Thank you so much bro 😇 please do share the videos with your friends and contacts. That'll be the best help and support for everyone ✌️

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

      @@SimpleSnippets Don't worry, I'm surely sharing this channel with my friends. ☺️

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

      Thank you so much bro 😇✌️

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

    Thanks 😊

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

    Thanks bro🔥👍👊

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

    Thank you sir

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

      You're welcome buddy. Do share the video with your friends too 😇✌️
      Also checkout my channel, there's a lot of informational videos you might find helpful 😇✌️

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

    Thank you so much ❤️

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

      You’re welcome 😊 Please do share the videos and our channel with your friends if you want to genuinely support me & our channel!✌😇

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

    it's really good

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

      I'm glad you like it. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

    • @lioneldsilva9805
      @lioneldsilva9805 4 ปีที่แล้ว

      @@SimpleSnippets definetly

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

    Best videos

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

      +Nash Hash hey Nash, thank you so much buddy for such wonderful comments and responses on many of my videos. This really motivates me a lot to make more video tutorials. Keep up the support buddy ✌️😇

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

    The peace at the end 🤦🏻‍♂️🤦🏻‍♂️😂😂

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

    nice one bro !!!

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

      Thank you so much buddy. I'm glad you liked the video. Please help me by sharing it with your friends and contacts buddy. That will be the best support for our channel 😋😊

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

    Ur too very good at explaining .......... but slower ur pace . U would be awesome

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

      Will keep this in mind and work on it 😊

  • @Khan-pf1zc
    @Khan-pf1zc 5 ปีที่แล้ว

    You are toooo crazey man...

  • @karthik.k8267
    @karthik.k8267 6 ปีที่แล้ว +1

    nice bro

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

      +Karthik keyan you're welcome buddy. Happy to hear that you liked this video. Do share the video with your friends and contacts and keep sharing the knowledge 😇✌️

  • @lituanambochon1312
    @lituanambochon1312 6 ปีที่แล้ว +5

    Best video. But you should speak slowly.

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

      Thank you so much for the positive feedback. And yes I'll surely try to slow down a bit. Sometimes I don't realize when I go with the flow about my speed 😅

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

      Your slow bro

    • @v.rprasad5377
      @v.rprasad5377 4 ปีที่แล้ว +1

      He's passionate. My talking speed is also high when I talk about something I like.

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

    1000th like

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

    First of all if you explain in Urdu or Hindi it will be good for everyone.. Second thing if we have to read the things which are written on the screen so we can also read it easy the purpose of watching is to get any explanation

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

    Another great video. Again Thank you for your time. I do have a question? I am using code::Blocks and when i make a new .cpp file and close the other files the compiler tries to run the ones that I had closed and not just the one I have open. I am using the same project for all files. The only way I can get it to work right is us /* */ on last file I closed and the new file will run ok. Is there an easier way.

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

      I don't have much of an experience with this IDE. So how about you use dev c++ ✌️

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

    I have a doubt, consider a function template which adds two numbers, and we want to take in those two numbers from the user, but first we need to store those numbers in some variables, so what should be the return type of those variables ? If we choose the return type as "int" but the user enters a "float" value, then only the integer part of the float data will be stored. So how to make use of templates to detect and store the data type of the entered data ?

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

      The return type should be the generic type (that is - 'T' or any other letter that you use to resemble the generic type) so that the program will automatically consider the type entered by the user at runtime :-)

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

      @@SimpleSnippets Thanks :)

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

      Most welcome bro 😇✌️keep up the support 😇

  • @sainiguharoy
    @sainiguharoy 6 หลายเดือนก่อน

    What if the function return type is void?

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

    If we want to check two nos. Which is greater, if two nos. Are of different data types say int and float then we don't know what will be the return type of the template function. I want to know if this can be achieved then how?

  • @liontalha7383
    @liontalha7383 4 ปีที่แล้ว

    What if i want to print the function is of integer type or float type in templates after giving values?
    template
    T add(T x, T y)
    {
    cout

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

    Difference between class & function template??

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

    I have one doubt can you please tell me at which stage of compilation it gets handeled? Does this happen at the stage of pre processing?

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

    Is it compulsory to use T and U only ? Can we use other than T and U??

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

      No no it's not compulsory to your T or U. You can use any other letter. Small Caps or big. But then you have to use that same character throughout ✌️😇

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

      @@SimpleSnippets thank you 😄

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

      Welcome Arati 😇

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

    Asslam o alaikum sir, mjy aik bt ki smj nu I apny int or double of kese combined Kiya aur float ko miss ku Kiya aur ink nmbrs int double Mila bs .5 ka kese Aya plzz clear soon

  • @kaoutarru4619
    @kaoutarru4619 4 ปีที่แล้ว

    Then how can i input the parameters?

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

    One question... In my book here it is written template instead of template in function template syntax. Is that the same?

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

    Where did u learner Cpp

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

      College, classes then everything online

    • @suryakarmakar4240
      @suryakarmakar4240 4 ปีที่แล้ว

      @@SimpleSnippets I am an ECE student can u suggest me some online sources

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

    Why we are needed to spend money in Udemy if vedios of such good quality are being here like this🙏

  • @he11owthere52
    @he11owthere52 4 ปีที่แล้ว

    I am using turbo c and I am getting an error on the line where template is written and the error is "line 3: , expected"

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

    Good video, but you speak too fast and not well articulated!! But the information you give is outstanding!!!

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

      Point noted. I will keep this in mind 😇
      Thank you for this genuine feedback 😇

  • @slappygamer2847
    @slappygamer2847 10 วันที่ผ่านมา

    Night owl respect++

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

    I have a scenario where I need to have 3 overloaded functions..
    double ConvertValues(double dValue);
    double ConvertValues(char* sValue)
    double ConvertValues(wchar_t *wValue)
    For char and wchar_t cases I assume values are coming as string and stored in it, I need to convert it as values and then do appropriate calculation, If double, I can directly send it to the computation..
    Can this be done in Function template?

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

    Are you marathi?

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

      Ho Marathi ahe mi 👍😊

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

      @@SimpleSnippets kadakkk bhava! proud of you bhava!

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

      @@sarthakmane2977 thank you bhava. Please channel and videos share karat rah. That's the biggest support you can give brother😊👍

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

      @@SimpleSnippets nakki bhava😃

  • @vardhanvarma1007
    @vardhanvarma1007 4 ปีที่แล้ว

    Thank you brother

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

    thank you 💓

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

    Thanks a lot

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

    thankyou
    😃

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

    Thanks a lot