Copy Constructor in C++ | C++ Tutorial | Mr. Kishore

Поділитися
Вставка
  • Опубліковано 13 гру 2024
  • C ++ Tutorial Videos | Mr. Kishore
    ** For Online Training Registration: goo.gl/r6kJbB ► Call: +91-8179191999
    💡 Also Watch
    C Language Tutorials: goo.gl/qDhJ2r
    Core Java FAQ's: goo.gl/qGh5mA
    Core Java Tutorials: goo.gl/NbaEge
    Java Programming Tutorials by Mr.Hari krishna:
    goo.gl/HThq6H
    Advanced Java Programming Tutorials by Mr.Nataraj:
    goo.gl/1U2Qgy
    Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.
    💡 Visit Our Websites
    For Classroom Training: nareshit.in/cp...
    For Online Training: nareshit.com/c...
    #JavaCollectionsFramework #Tutorials #Videos #corejava #Quiz #Clanguage
    --------------------------
    💡 About NareshIT:
    "Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations
    --------------------------
    💡 Our Online Training Features:
    🎈 Training with Real-Time Experts
    🎈 Industry Specific Scenario’s
    🎈 Flexible Timings
    🎈 Soft Copy of Material
    🎈 Share Videos of each and every session.
    --------------------------
    💡 Please write back to us at
    📧 us.training@nareshit.com/ 📧 online@nareshit.com or Call us at the USA: ☎+1404-232-9879 or India: ☎ +918179191999
    --------------------------
    💡 Check The Below Links
    ► For Course Reg: goo.gl/r6kJbB
    ► Subscribe to Our Channel: goo.gl/q9ozyG
    ► Circle us on G+: plus.google.co...
    ► Like us on Facebook: / nareshit
    ► Follow us on Twitter: / nareshitek
    ► Follow us on Linkedin: goo.gl/CRBZ5F
    ► Follow us on Instagram: goo.gl/3UXYK3

КОМЕНТАРІ • 117

  • @NareshIT
    @NareshIT  5 років тому +6

    Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL

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

      conio.h is only in Turbo C++, what is the similar header file for standard C++ ?

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

      this is only shallow copy constructor, you forgot deep copy constructor.

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

      If i dont want to write copy constructor then what is another option for copy constructor...
      Plz guide...

  • @BiharCentralSchool
    @BiharCentralSchool 3 роки тому +3

    I got tired to search & see the many lectures on Copy Constructor but didn't understand, BUT THIS 15 MIN VIDEO TAUGHT ME FROM SCRATCH. THANK U SIR

  • @arjunsuresh932
    @arjunsuresh932 7 років тому +8

    I rarely comment on UA-cam..But this is a very clear nd solid explanation that i found difficult to understand elsewhere out in the internet..Thank you SIR :)

  • @gamuchiraimureyani281
    @gamuchiraimureyani281 6 років тому +5

    Sir you have excellent explanation better than my teacher you explain everything clearly.

  • @ektajha69
    @ektajha69 4 роки тому +5

    Ur teaching technique is impeccable sir.Respect 🙏

  • @AaryaGhuge
    @AaryaGhuge 4 роки тому +26

    Thnx for helping me study in quarantine...🙏🏻

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

    excellent explanation sir...my all concepts of constructors are get cleared by watching this video......

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

    Super and nice prof. i have ever seen in USA!!!!

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

    Thank you Naresh technologies for making concepts so simple.

  • @Pluxlite
    @Pluxlite 6 років тому +3

    Oh thank you! this is the first time i actually understood copy constructor!

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

    Best explanation in the world.

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

    Very good explaining, excellent ! Thank so much from Ukraine

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

    Has to be the most vivid explanation on copy constructors.

  • @KaifAli-k8m
    @KaifAli-k8m 8 місяців тому

    One of the best lecture on Copy Constructor......😊

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

    Sir please make a video on Parameterized Constructor

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

      It is there in playlist

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

    Why don't we directly write old instead of &old shouldn't it make old a copy of the class passed
    for eg if we write sample s2(s1) then old is a copy of s1 and thus a=old.a
    because this is how we pass integers also
    for eg:
    print(int num)
    {
    cout

  • @aishwaryabobe5397
    @aishwaryabobe5397 7 років тому +14

    Excellent explaination sir... Thanks a lot.. upload all videos related to c++

  • @prateekbhojwani9909
    @prateekbhojwani9909 6 років тому +2

    I appreciate Mr. Kishore for such videos. Nice work . Keep going

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

    excellent explanation sir.... thank you so much

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

    Best explanation , thank you sir.

  • @KashishGulati-bv6gv
    @KashishGulati-bv6gv 6 місяців тому

    Thank you sir you help in understanding the topic easily 🙏

  • @harsh.sharma
    @harsh.sharma 5 років тому +23

    Who is having exam tomorrow?

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

    this is the best explanation by far!

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

    Excellent.. you make people's life easier.👍

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

    Awesome xplanation sir
    Tq very much

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

    Thank you Sir for this video, Sir please make a video on Parameterized Constructor

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

    It's so useful for me
    Thank you so much

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

    Perfect n smooth explanation

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

    superb sir Thank You 🙏

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

    tiz is first time understood da copy constructor after watching ur videos sir tqqq

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

    Very good lecture

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

    I would like to bring your attention towards syntax of copy constructor and importance of const keyword. const keyword should be added to avoid accidental modification ,a temporary object cannot bind to a non-const reference

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

    Very well explained keeping the grips on the essential part of the programs.

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

    Excellent👍

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

    Good explanation about copy constructor.

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

    Explanation super ga undi mi videos download chasukunna from play store

  • @SHRAVANKUMAR-yu5cv
    @SHRAVANKUMAR-yu5cv 6 місяців тому

    Great 🙏

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

    Very good explanation. Thank you.

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

    The reference object passed should be const in nature (preferebly)

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

    Very good explanation sir

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

    Thank You sir !

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

    Super Explanation Sir

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

    Thank u sir hats of u

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

    Great Explanation , Thankyou

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

    thank u it is very useful for me to understand inheritance

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

    Perfectly awsome🥰

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

    Thanks a lot sir, really great explanation

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

    amazing teacher ı like your way of explaining the ideas

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

    If you gave example with pointer and shallow copy and deep copy in this topic it will much helpful to all

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

    thank you sir, u r real kind teacher

  • @SarathKumar-tm6ui
    @SarathKumar-tm6ui 5 років тому

    thank you so much sir wonderful explanation

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

    Brilliant

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

    Sir U haven't made any video on parameterized constrictor please make one video on it

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

    sir i have a doubt regarding the calling of the copy constructor.... in void main... shall it be sample &s2(s1) ???? please reply sir..!!
    best xplanation ..!!thanks alot sir..!!

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

    U r great sir

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

    Thanx for helping

  • @neerajmahajan9457
    @neerajmahajan9457 5 місяців тому

    Best♥

  • @govinddwivedy8145
    @govinddwivedy8145 7 років тому +2

    Sir will you please clarify ,why you used & in copy constructor

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

      copy constructors depends on reference(&) to same class type.

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

    I have a question: a and b are private variables of s1, using reference variable can bypass data hiding then?

  • @unfinished.education
    @unfinished.education 7 років тому +1

    supper se upper sir

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

    good one..

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

    In c++ there is default copy constructor. No need to write separate copy constructor until unless use the dynamic memory allocated to avoid dangling pointer. Sir my sincere request pls give the proper subject to the learners.

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

    Sir ... I don't know why u have deleted the symbal & at timestamp 11:25 ..? anyone plz clarify

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

    There should be use of const operator in copy constructor argument. Pls check

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

    His English accent is just perfect than any other Indian peoples :3

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

    Excellent

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

    thank you sir...

  • @jishnujishnu849
    @jishnujishnu849 6 років тому +2

    What is the relavance of &old there
    Can you please explain

    • @nilaypaul9810
      @nilaypaul9810 4 роки тому +5

      The reference variable means "An alternative Name for the previously defined variable or object or whatever"
      So when Sample S2(S1) is passed; that means the object S1 is got new name of "OLD"
      Now, as you can see S1 object has for a= 10 and b = 20;
      So, in S2,
      a = old.a; //old is object S1
      b = old.b //old is another name for object S2

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

    Sometimes we make use of "const" keyword in copy constructor(like sample (sample const &old) What's the purpose?

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

      I would like to bring your attention towards syntax of copy constructor and importance of const keyword. const keyword should be added to avoid accidental modification ,a temporary object cannot bind to a non-const reference

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

    awesome sir

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

    What is shallow and deep copy ???

  • @sammydeew4773
    @sammydeew4773 6 років тому +2

    can u pls explain C programming

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

    Sir but "this" function me . Nhi chalta na wo to java me hota hai.....cpp me this-> aisa hota hai na shyad???

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

      (*this).a and this->a are different syntax for the same operation. You are right that -> is a typical java operator, but it is implemented in newer C++ as well.

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

    If you are coping all the value of s2 in copy constructor then why do you used parameterize constructor ...
    Ans please🙏🙏🙏

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

    Sir where is parameterized constructor??

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

      Watch video number 31 , overloading example 1

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

    Sir can we write s2=s1 like this?

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

    thanks sir

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

    Add more session sir

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

    What about copying pointer variables?

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

    where is the parameterized constructor video?? Can anyone share the link??

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

    best sir

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

    sir,why you removed & in s2

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

      That should not be there

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

      Sample (S2)=S1 Equals to sample S2 = S1, so & is not required

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

    I think you have to use constant for reference object in copy constructor parameter, otherwise the old object values can be manipulated inside copy constructor, just a suggestion from my side.

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

    I believe the answer will be 10,20 and 10,20
    If the answer is same twice, what is the use? ,🤔🤔🤔

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

      Let's say you need to create the same object twice (or more) and you need to change one of them during your program or whatever... This is how you should create the same objects

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

    Good, thanks for the lesson. But everyone's using copy contructor even when they assign as s1=s2. Why's copy constructor also invoking at such occurrence? Anyone knows? :)

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

      Brother both are valid statement just we need to understand that this s2 value is passing In the constructor.like if we pass two values in constructor we write like s1(4, 3) if we need to pass only one parameter then s1=4 this way is also correct

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

    I think the syntax is class_name(const &old_obj);

  • @s.chinna3722
    @s.chinna3722 3 роки тому

    sir in dev c++ software . its showing error when I place . when I remove (.h) its compiling . can u please give me reason sir

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

      When we use turbo c++ or any old complier (I think ) then we need to use .h otherwise in visual studio or other new compilers there is no need

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

    where is parameterized constructor video??

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

    lect 30 then 35 then 34

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

    Asp mere ko thik se Nahi samjha maye

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

    Thank you very much sir. . very well explained !

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

    thank you soo much sir

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

    thank u sir

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

    Great sir

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

      explanation are up to the point and can easily understand sir.tnq sir