Lecture 20 Template in C++ Part 1 Hindi

Поділитися
Вставка
  • Опубліковано 3 лис 2024

КОМЕНТАРІ • 471

  • @parthshr.5251
    @parthshr.5251 2 роки тому +51

    Video uploaded 5 years ago , students still learning from it . Power of free online education .

  • @PiyushKumar-de3dr
    @PiyushKumar-de3dr 9 місяців тому +4

    The whole topic was uploaded 8 year ago but... the playlist is best among all the playlist...❤❤❤❤❤

  • @being_aslam_tiger
    @being_aslam_tiger 5 років тому +35

    still watching your videos in 2019..lots of love sir ji

    • @abhayrai1724
      @abhayrai1724 4 роки тому +9

      Even in 2020 it's still a gem .....and it's brightness we'll never fade ....bcom more and more with period of time......lov ur work sir......bssss aawaj bht km aata kafi dikkt hoti h😬😬😬 pr phir bhi life iz good with this🤓🤓🤓🤓🤓🤓🤓💎💎💎💎💎💎

    • @tejasdeore8340
      @tejasdeore8340 4 роки тому +3

      This video's are gem except for few codes which needs needs some modifications and libraries to be included

    • @aakashagarwal146
      @aakashagarwal146 2 роки тому +3

      2022

    • @anshitagupta5893
      @anshitagupta5893 2 роки тому

      We r watching this in 2022 may.
      ✌️

    • @vineetjadhav7875
      @vineetjadhav7875 2 роки тому

      Legends watching in 2022 🤣🤣

  • @SunniHussainiPaigham-78692
    @SunniHussainiPaigham-78692 7 років тому +8

    Ur way of clearing out the concepts is salutable. Thanks

  • @iammandeep11
    @iammandeep11 7 років тому +1

    kya baat h sir g itne sare articles padh liye mene bt apne ik hi video me simply sare doubts clear kr diye thnkuuu so much

  • @wakeelahmad2820
    @wakeelahmad2820 2 роки тому

    Love , respect and appreciation from Pakistan, he is really a master !!!👍👍👍

  • @animeshkumarchoudhary6324
    @animeshkumarchoudhary6324 4 роки тому

    Kuch alag level pe hi simple kar diya hai aapne concepts ko

  • @arkadey7589
    @arkadey7589 7 років тому +3

    sir this video is awesome!! understanding templates from book is so difficult...you've describe it quite amazingly...

  • @NvcVikasChauhan
    @NvcVikasChauhan 7 років тому +25

    sir u are just awesome ....are u teacher in any IIT,nit or gives only online lectures​...

  • @muahmmadhamza8571
    @muahmmadhamza8571 6 років тому

    I have never subscribed any indian channel before.. but i admired you as my teacher so i subscribed your channel for the very first time. awesome tutorials ..(y)

  • @raoshahbaz3030
    @raoshahbaz3030 5 років тому

    Ap nay buht achy say smjhaya hai, function template, Sir Awesome

  • @WNOfficialfour
    @WNOfficialfour 2 роки тому +4

    for anyone having the return type doubt.. here is the answer
    #include
    using namespace std;
    template auto big(X a,Y b)
    {
    return (a>b)?a:b;
    }
    int main()
    {
    cout

  • @narendraagrawal4803
    @narendraagrawal4803 9 років тому +6

    Bhalaiiiiiii.. ki supplyyyyyyyyyy... chaluu rakhna..... Guru ji.... God Bless U... for that kind of work...

  • @vishaljha2756
    @vishaljha2756 3 роки тому

    2021 and this tutorial is still better than.. many other tutorial on youtube

  • @Jarurathai
    @Jarurathai Рік тому +1

    The decltype(a + b) in the big() function declaration is used to infer the return type of the function. The decltype keyword takes an expression as its argument and returns the type of that expression. In this case, the expression is a + b, so the return type of the big() function is decltype(a + b).
    This is necessary because the big() function is a template function, which means that it can be used with any type of data. The compiler needs to know the type of the return value in order to generate code for the function. The decltype keyword allows the compiler to infer the return type of the function, even if the type of the arguments is not known at compile time.
    For example, if you call the big() function with the arguments 4 and 5.8, the compiler will infer that the return type of the function is double because 5.8 is a double. However, if you call the big() function with the arguments 4 and "hello", the compiler will infer that the return type of the function is std::string because "hello" is a std::string.
    The decltype keyword is a powerful tool that can be used to infer the type of expressions at compile time. This can be useful for a variety of tasks, such as inferring the return type of functions and determining the type of variables.

    • @ashishkharb7440
      @ashishkharb7440 Рік тому

      Yes bro.. that's what i was wondering. thank you

  • @D_ShivamJagtap
    @D_ShivamJagtap 4 місяці тому +1

    next level teaching sir...🔝

  • @yogeshrajput6631
    @yogeshrajput6631 7 років тому

    sir mine cpp class Ki h phir b template kya hota h Abbi tk pata nhi tha. lekin aap ke lecture se 2min. me clear Ho gaya.
    thank u so much sir...

  • @nishanthmekala1409
    @nishanthmekala1409 5 років тому +1

    explaining very well by taking superb, fantastic real-world examples.

  • @vijayKumar-xq1wu
    @vijayKumar-xq1wu 4 роки тому

    x class,here data type of both variable are different and we don't know which value is greater ,we have to return maximum value of a and b as same data type which is alloted . so which value data type we have to write before class(return type)

  • @SaurabhKumar-uw2tc
    @SaurabhKumar-uw2tc 2 роки тому

    Sir ap bhot accha pdate h ab to programing easy lgne lgi h

  • @dikshajain9845
    @dikshajain9845 3 роки тому +22

    I have a question when there are two arguments of different types
    Then we make two type x, y but what about return type . It will still x ??

    • @Wkspace
      @Wkspace 3 роки тому

      Diksha mujhe bhi same doubt hey kya apko iska answer milla ki return type me X likhe ya dono X,Y likhna hey

    • @namratabhargava3052
      @namratabhargava3052 3 роки тому

      Same doubt

    • @AnuragKumar-cb5lr
      @AnuragKumar-cb5lr 3 роки тому +8

      Ya you can not write x or y there. You have to return the type of that who can accept answer of both datatype after the operaton, between x and y. Here is example...
      template
      T1 big(T a,T1 b)
      {
      if(a>b)
      b=a;
      return b;
      }
      int main()
      {
      cout

    • @padhaiparcharcha
      @padhaiparcharcha 3 роки тому +1

      Here is a solution ⬇️
      #include
      using namespace std;
      template
      int big(x a,y b)
      {
      if(a>b)
      {
      cout

    • @ravneetsingh8790
      @ravneetsingh8790 3 роки тому +1

      @@padhaiparcharcha iska return type to humesha int hi rhega bhai 😶😶

  • @vakhariyajay2224
    @vakhariyajay2224 2 роки тому +1

    Thank you very much. You are a genius.

  • @Education..29071
    @Education..29071 Рік тому

    Aapko jitna thanks kare kam h keep doing this great job sir😊☺

  • @bcabca3030
    @bcabca3030 5 років тому +2

    💞🇮🇳💞 Sir Your Teaching Mehod Outstanding, Brilliant, Excellent

  • @deepakchawla7773
    @deepakchawla7773 6 років тому +8

    First of all Thank you Sir for making these wonderful series!
    sir i have a doubt that if i am doing like ...
    template
    then how can i decide return type either X or Y of my function.
    Thanks in advance!!

    • @Jarurathai
      @Jarurathai Рік тому +1

      I have the same question & I am a beginner please tell me answer of this question

  • @achyutkumarsingh7308
    @achyutkumarsingh7308 4 роки тому

    sir your videos are really best for all programmers.thank you so much....keep uploading sir

  • @pravinthakur7791
    @pravinthakur7791 4 роки тому

    I think ek naya placeholder banana chahiye aur woh function ke return type me likh dena chahiye jiski wajah se jis tarah ka value function return krega usstype ka placeholder ban jayegaa
    I think yeh zyada useful hogaa

  • @hinafraz528
    @hinafraz528 7 років тому

    one of the best teacher in my life....

  • @pareshmandare8770
    @pareshmandare8770 2 роки тому +1

    For another type of value we add another class as class Y but while declaring function...
    X funct_name (X a, Y b) or we can type
    Y funct_name (X a, Y b).

  • @theonlynits
    @theonlynits 9 років тому

    your videos are too useful ..i understand every topic easily just because of your awesome videos.. thank you so much sir ..

  • @kamaldakshkrishnan9990
    @kamaldakshkrishnan9990 Рік тому +1

    Top Notch

  • @nc4924
    @nc4924 Рік тому

    Sir your way of teaching is very best

  • @jeevanswamy3340
    @jeevanswamy3340 7 років тому +5

    1. Make two template function using a C++ template function concept.
    FIRST TEMPLATE FUNCTION:
     First template function will find a specific value from a one dimensional array.
     You should pass the array itself, array size and as well as the searching value for the
    argument of the function. Name the function as search_value.
     The function will return “FOUND” if value matches with any value of the array
    otherwise it will just send “NOT FOUND”.
    SECOND TEMPLATE FUNCTION:
     Second template function will find the second max value from a one dimensional array.
     You should pass the array itself and array size for the argument of the function. Name the
    function as second_max.
     The function will return the second largest value from the array.
    MAIN FUNCTION:
     In the main function create 3 separate arrays each one for integer, double and character
    data type and initialize them with some values.
     Now for all of them find a specific value and also find the second largest value.
    What will be the Code for this??
    Kindly Tell me sir

  • @unlocksmile
    @unlocksmile Рік тому +1

    Excellent sir 👌

  • @dipanshusharma9851
    @dipanshusharma9851 8 років тому +2

    thank u sir for this amazing video...my doubt is cleared after watching your video

  • @kanhaiyasingh9717
    @kanhaiyasingh9717 3 роки тому

    u r my all time favourite teacher......glad to hv u🙂

  • @exclusiveglobaleducation2658
    @exclusiveglobaleducation2658 5 років тому

    Sir your videos is very useful .no other teacher can not explain.

  • @saadrao804
    @saadrao804 Рік тому

    after 8 years and 5 months it is still worthy...

  • @iamsahebgiri
    @iamsahebgiri 5 років тому

    Nehi sir suggestion zaroorat nhi hai! Aap to itna mast samjhate ho!

  • @swapnilkodam1677
    @swapnilkodam1677 4 роки тому

    For pure virtual function and other concept also you given a example but you have to give example with programming and declair a variable also with the function and like a private public protected variable also declair and explain properly

  • @kartickchandramanna267
    @kartickchandramanna267 2 роки тому

    Awesome Lecture 👍
    Thank you sir 🙏

  • @gopalprasad3613
    @gopalprasad3613 9 років тому +4

    can u plz upload a video for class template also.
    sir u r really doing a great job .plz cover all topics of c++
    thanx.

  • @aariffmohd4980
    @aariffmohd4980 2 роки тому

    Amazing explanation sir...i liked, shared it

  • @vipingoad8885
    @vipingoad8885 Рік тому

    Sir your explanation way is very cool and nice

  • @facttecher3039
    @facttecher3039 Рік тому

    template
    X big( X a, Y b)
    sir isme a and b dono alag data type hai, jo bada hoga uska return type kaise decide hoga jo big k pahle likha hai

  • @MuniramChaurasiya
    @MuniramChaurasiya 4 роки тому

    very helpfull for us.........thank you sir........keep it up

  • @sunnyjain6731
    @sunnyjain6731 2 роки тому

    Awesome way of explaing .And i beleive almost all the college students teaches from suarbh sukla.sir instead of college teacher.

  • @md_ashraf7259
    @md_ashraf7259 2 роки тому

    Thank you so much sir for great explanation.

  • @RanjeetSingh-dy8qu
    @RanjeetSingh-dy8qu 3 роки тому +1

    Goodd

  • @prashantmudaliyar9079
    @prashantmudaliyar9079 9 років тому +1

    ek number sir kya sika the hu really head off to u ...

    • @adityajangle3963
      @adityajangle3963 9 років тому +1

      +prashant mudaliyar head off ....i mean are u serious

  • @arjunkapoor5218
    @arjunkapoor5218 6 років тому

    namespace is not a predefined library in c++, it is a keyword provides methods for preventing name conflicts

    • @amritpoudel4655
      @amritpoudel4655 2 роки тому

      that methods for preventing name conflicts is predefined in library of c++ so it is.

  • @harshdhawale2669
    @harshdhawale2669 3 роки тому

    He knows what will come in our mind

  • @cbysaurabhshuklasir32
    @cbysaurabhshuklasir32  9 років тому +9

    ua-cam.com/channels/u4ztYtW-Bg1KIfcLAULtVQ.html
    SUBSCRIBE this Channel for Data Structure

    • @rituraj7318
      @rituraj7318 7 років тому

      Saurabh Shukla Sir can u plz explain me this { Main function will return value where....Like in a normal function value is returned from where it is called but who is calling main function!}.
      int main()
      {
      }

    • @DevVerma-j1e
      @DevVerma-j1e 2 місяці тому

      @@rituraj7318 operating system will call main function

  • @akshaymule2169
    @akshaymule2169 4 роки тому

    Explained very well. Sir you are awesome.

  • @meghnasingh9941
    @meghnasingh9941 5 років тому +3

    Sir hats off to you for this wonderful explanation : )

  • @Bobby-mf6fw
    @Bobby-mf6fw 6 років тому

    Sure this lecture is useful for desired people.
    Thank you sir

  • @soniachhabra7168
    @soniachhabra7168 8 років тому +1

    this information is very helpfull for me thanku so much sir..

  • @rohitkeshari56
    @rohitkeshari56 2 роки тому

    Thanks for making this topic so simple

  • @akshitmehta2532
    @akshitmehta2532 4 роки тому

    Bohot badiya coursera par bi itna badia nahi bataya tha jitna yaha bataya hai

  • @1997rohitrox
    @1997rohitrox 6 років тому

    If we are using two different type of place holder for a float and int argument then which value will be returned by seeing the fact that the function returning value is X. ???

  • @rishabhraj8497
    @rishabhraj8497 7 років тому

    Thanks Sir. Love the way you teach.

  • @kronkner_8192
    @kronkner_8192 Рік тому

    even after 7 years this vid is a reason why students can still pass their exams lol

  • @rubengurung1879
    @rubengurung1879 9 років тому +1

    wow sir, you are great.... i haven`t understood concept of template in class but you make understand...i like your teaching way... its great... sir do you have the tutorial for uml and data base management system... if you have tutorial it would be great....

  • @narendraagrawal4803
    @narendraagrawal4803 9 років тому +2

    Awsm work.... You made my confidence top of the world...........waiting for more videos of data structure in c++
    plzzzzzzzzzz upload sooon.... it really help us lot... Charan Pranam... "Guru Ji......." u r fantastic....

    • @gaurav_18_
      @gaurav_18_ 5 років тому

      brother where are you now? what was you experience about mysirg....please share

  • @shyamkachhadiya4964
    @shyamkachhadiya4964 6 років тому

    awesome this feature reduces a lots of work

  • @RiyaSharma-fk5ok
    @RiyaSharma-fk5ok 8 років тому +1

    Thank you so much sir your lectures are very helpful

  • @ramanpreetkaur6822
    @ramanpreetkaur6822 5 років тому

    this lecture is very nice sir .........................thanku sir but some time your use the marker it was not too good to understand

  • @samarpandas9519
    @samarpandas9519 4 роки тому

    Awesome video

  • @divyanshusalve8173
    @divyanshusalve8173 6 років тому

    Thank you sir for very good explanation.

  • @chottopakhi7111
    @chottopakhi7111 9 років тому +1

    you are too good. cann't wait for the upcoming clearification.

  • @saurabhbakshi2707
    @saurabhbakshi2707 9 років тому

    thank u sir
    upke a bala tuitorial mayray ko a6i lage
    upka sabhe tuitorial a6a hy
    from saurabh bakshi
    kolkata, west Bengal

  • @RitikKumar-lo4by
    @RitikKumar-lo4by 8 років тому +46

    if using two diffrent type of argument in same function the template ,but in the return type of function is "x" ??

    • @ketulkumar3289
      @ketulkumar3289 7 років тому +1

      Yaa, I also have the same question.

    • @satyamgupta6030
      @satyamgupta6030 7 років тому +1

      Ritik Kumar correct bro i also gave the same question

    • @rajnikantjaiswal4656
      @rajnikantjaiswal4656 7 років тому +25

      it depends on what you need to return...
      if you want to return int ---- use placeholder of int ---- X
      if you want to return double ---- use placeholder of double ----- Y
      Ex: - X big(X a, Y b)
      9 big(4, 5.6) ---- as X in argument --- you pass an int 4 -- so return int 9
      Y big(X a,Y b) ---- as Y in argument --- you pass a double 5.6 -- so return double 9.6
      9.6 big(4, 5.6)
      NOW
      some has questions like if i take X big(X a, Y b)
      9 big(4, 5.6) -- now clearly from argument, X is int and Y is double -------- return type X --- so int 9
      9.6 big(5.6, 4) ----- but here X is double and Y is int -------- return type X --- so double 9.6
      soln:-no need to take different placeholder
      template
      X big(X a, X b)
      9.6 big((double)4, 5.6)
      9.6 big(5.6,(double)4)
      9 big(4, (int)5.6)
      9 big((int)5.6,4)

    • @AtulKumar-sj8bu
      @AtulKumar-sj8bu 7 років тому +2

      if we dont know which value will return, user will inout the value, in that case what we will
      do

    • @nikhilnambiar7160
      @nikhilnambiar7160 6 років тому +1

      X just act as generic data type

  • @AnkurLathiya-software-engineer
    @AnkurLathiya-software-engineer 9 років тому +1

    nice presentation

  • @akshaypatil5487
    @akshaypatil5487 4 роки тому

    keep it up

  • @learningcomputerwithtmkhan6087
    @learningcomputerwithtmkhan6087 2 роки тому

    well done sir

  • @naatinjavedbhatti1491
    @naatinjavedbhatti1491 6 років тому

    Its really helpful Sir. Thank you so much!

  • @megavathpremkumar7456
    @megavathpremkumar7456 5 років тому

    Excellent

  • @saurabhtaroliya7047
    @saurabhtaroliya7047 4 роки тому +1

    Sir if we use 2 place holder in same program then what will be it's return type

  • @MuhammadZubair-xw2pf
    @MuhammadZubair-xw2pf 6 років тому

    Sir you explained very well.thank you.may you live long and prosper

  • @rituraj7318
    @rituraj7318 7 років тому

    Main function will return value where....Like in a normal function value is returned from where it is called but who is calling main function!

  • @owaisekhan2129
    @owaisekhan2129 5 років тому

    Nice explanation sir

  • @SaumyaSharma007
    @SaumyaSharma007 4 роки тому +1

    Thank you so much sir 🙏🤗

  • @AnkitKumar-lg5hf
    @AnkitKumar-lg5hf 4 роки тому

    Very simply explained i like the content sie

  • @GauravKumar-ux1os
    @GauravKumar-ux1os 3 роки тому

    U just nailed it sir🙏

  • @hariomt159
    @hariomt159 3 роки тому +1

    thanks sir❤❤

  • @shreeshkulkarni2547
    @shreeshkulkarni2547 9 років тому

    sir pls upload lucture on class templates also. very clear and concise explanation

  • @shivdubey432
    @shivdubey432 3 роки тому

    Sir ji big fan. U are my inspiration 😍

  • @vijaykumarsharma2734
    @vijaykumarsharma2734 9 років тому

    Thanks a lot Sir.
    Please upload second part of template.it's very helpful.

  • @sanjeevanipatwa1986
    @sanjeevanipatwa1986 6 років тому

    Very useful video 👍

  • @funworld6769
    @funworld6769 7 років тому

    superb👍👍👍👍👍

  • @akashdwivedi2110
    @akashdwivedi2110 8 років тому

    Your explanation is amazing

  • @khalidkhursheed5821
    @khalidkhursheed5821 3 роки тому

    What if return type of function is not known as we don't know what will he the result in the body of function, then should we take another placeholder for it?

  • @yogeshnain6391
    @yogeshnain6391 6 років тому

    Sir isme, function ki return type se koi problem nhi hoga kya, aapne X li ha to.... Agar float vaali bddi value hui to Ye to int type ki return ker dega..... This is data loss....

  • @vishalchauhan9832
    @vishalchauhan9832 6 років тому

    Very nice lecture!

  • @mdnavid826
    @mdnavid826 9 років тому

    It is very helpful!! I like all of your tutorials. But i have found that many of the tutorials have only the Part1 available. Like this video "Lecture 20 Template in C++ Part 1 Hindi", there is only one part. Can you please upload the Part 2 of all the tutorial sessions? so that we could know more details!! Anyway thanks your great effort!! :)

  • @ritikshrivastava9442
    @ritikshrivastava9442 3 роки тому +1

    11:28 you said we can create more than one place holder but you're return X type what if the return value is of Y type then

  • @ekramansari6205
    @ekramansari6205 2 роки тому

    Awesome sir

  • @manishgarg1701
    @manishgarg1701 7 років тому

    Sir...outstanding video !! love you

  • @bilal8187
    @bilal8187 4 роки тому

    watching in 2020
    good work

  • @arpmat22
    @arpmat22 8 років тому

    Simply awesome