9:33: z1 ka value x ke barabar aayega jo ki 0 hai. 12:40: for z2 = z, copy constructor will not be invoked. 13:28: for Number z3 = z, copy constructor will be invoked.
1. Number Z1(x) is copied using "shallow copy constructor", which means that Z1 and x share the same memory location. 2. Number Z1 = x; is copied using "deep copying constructor", which means that Z1 and x are independent, and changes made to one will not affect the other.
Bro app code runner k settings pe ja kar 'save and run' wala option check karlo tab apko bar bar error nahi milega jo naa save karne par milta hain.....
Hello Harry bhai.....! How are you? In this video, the classes you are creating are underlined. Kindly tell me that how you underlined the specific text in VS Code??? Anxiously waiting for your reply. Thank you.
Harry bhai please please please make a video on how to learn programming or how to learn a language completely and from which resources and also how you learned programming and when you started learning it and from where you learned so well and how you developed your interest in programming please Harry bhai make a video on it because many of us wants to know more about these things
9:46 there will be no error but I can't say what value it will print whether 0 or x but I think it should print x . Edit: Got it when there is no copy constructor is present in our program than complier supplies it's own copy constructor . 12:29 : Copy constructor will be invoked because when we create object z2 then default constructor will be called because no parameters is passed to z2. 12
Is it necessary to always add default constructor for every constructor program we write ? and Can we use this default constructor for every type of constructor we used ?
at 9:46: Since, we have assigned the default value of any object pertaining to the class Number as 0, hence, in my opinion, 0 should be returned in place of an error.
No function is called using dot operator , only constructor is get called when object is declared. Here object of copy constructor that is x is copied to Z1 which is 0.
What is the purpose of making a copy constructor if the compiler can create its own default constructor? please share some link where i can easily understand why copy constructor is needed?
Harry bhaiya plz makes notes of c++ with quiz with questions just like u make for c hum padh to rahe hai pr JB tak questions nhi rehege to dimag me bethege kese
does the copy constructor only assign value? Because at 9:30 when the default copy constructor was invoked, it automatically did the value assignment operation.
hey harry, here is the code: #include using namespace std; //complex class: handles all the functions related to complex numbers. class complex{ int real,imag; public: complex(int x, int y){ real = x; imag = y; } void display(){ cout
harry bhai, ye 14:27 pe jb ek naye object to purana object creae kiyato error kiyon nhi aya? jaise jn hm kisi object ko koi value assign krte hai to we write Class obj= Class(a,b) .. so why you are doing Class obj2=obj not Class obj2=Class obj ??
These tutorials are meethi davai for us
Why ??🤔
Us nhi, me bol..........meethe logo ko har chiz meethi lagti he🤣🤣🤣🤣
Tiktoker lag rha he, sala meetha launda
Because he is meetha
@@portbiar3678hahahahahhahahahahahah
Harry sir please make a playlist on coding questions which is asked in interview( company to company).
Since I have been answering many people's questions in your comments you should give my idea a go sir
9:33: z1 ka value x ke barabar aayega jo ki 0 hai.
12:40: for z2 = z, copy constructor will not be invoked.
13:28: for Number z3 = z, copy constructor will be invoked.
I love how precise the explanations are and the way you teach.
Bhaiya , aap bahut acha padhate hain , sab kuch samjh aata hai .
Mza aaa gaya
9:42 there will be no error as we predefined x as Number(3) so it stores the value of Number(3) so that value passed through that object..
:)
Thank you so much Harry bhaiya❤, for providing such a great knowlegde in so easy to understand way !!
1. Number Z1(x) is copied using "shallow copy constructor", which means that Z1 and x share the same memory location.
2. Number Z1 = x; is copied using "deep copying constructor", which means that Z1 and x are independent, and changes made to one will not affect the other.
thx bro😀 was looking for this concept only and you made me clear with two lines of comment only
Thank you so much Harry Bhai! I have been learning a lot daily! And the examples used are extremely understandable. Thank you for taking the effort
@HAMZA khan this is a constructor that takes another object as argument, and assigns value of referenced object variables to the newly created object
@HAMZA khan ds and algo is always nice
Bro app code runner k settings pe ja kar 'save and run' wala option check karlo tab apko bar bar error nahi milega jo naa save karne par milta hain.....
Your teaching style is awesome the examples you give is excellent
1M new subscribers in one year. Tremendous growth Harry bhai ! 😮
Hello Harry bhai.....! How are you?
In this video, the classes you are creating are underlined.
Kindly tell me that how you underlined the specific text in VS Code???
Anxiously waiting for your reply. Thank you.
what is the difference between a copy constructor and constant copy constructor.
i.e. 1.) copy (const copy &obj)
2.) copy(copy &obj)
you are a great mentor harry sir btw Ide kaise sundar kare
Wowww कितना अच्छेसे explain किया आपणे हॅरी भाई😍😍🔥🔥
Harry bhai please please please make a video on how to learn programming or how to learn a language completely and from which resources and also how you learned programming and when you started learning it and from where you learned so well and how you developed your interest in programming please Harry bhai make a video on it because many of us wants to know more about these things
He did B. Tech and M. Tech dual degree from l. I T kharagpur with silver medal and best student award winner.
10:35 default copy constructor, without any copy constructor even if we call copy constructor there is no error
Imp consp 12:52
Consp 13:26
Thank you so much for such a great knowledge.
Thank You 🙏🏻
Helo sir, I watched all ur machine learning tutorial and can you upload videos on Time series analysis, boosting and bagging, SVM, tree model etc
9:46 there will be no error but I can't say what value it will print whether 0 or x but I think it should print x .
Edit: Got it when there is no copy constructor is present in our program than complier supplies it's own copy constructor .
12:29 : Copy constructor will be invoked because when we create object z2 then default constructor will be called because no parameters is passed to z2.
12
Is it necessary to always add default constructor for every constructor program we write ?
and
Can we use this default constructor for every type of constructor we used ?
Bhaiya thanks for making playlist. Hope this quarantine we learn full c++ as we have so much of time.
Best Teacher In my entire life till now love you bhaiya 🥰🥰🥰🥰
Need videos on competitive programming💛💚
yes
Can you please explain here shallow copy and deep copy ? Thanks
very good video, best explanation.
Best tutorial on C++
great sir you are simply great
and happy teachers day
Harry bhai shandar video hai, mujhe is topic me problem aati thi ab samajh aa gya 👌
But Harry tumari video to muze bohot Anand deti hai 😁👍🙏.. thanks for awesome content
man, such a helpful video. thank u so much sir.
thank you harish bhai very informative tutorial
Program same hi work kare ga copy constructor ko hide karna sa bhi
Make videos on competitive programming. Please ...
9:45 No error
12:29 Copy Constructor will not be invoked
13:36 Copy Constructor will be invoked
at 9:46: Since, we have assigned the default value of any object pertaining to the class Number as 0, hence, in my opinion, 0 should be returned in place of an error.
Glad to have u as a teacher sir !
Yes copy constructor will invoke, as just after defining the object we are equating it with another object.
9:38 we have a blank constructor with 0 as default value of "a" so that will be passed and there will be no error.
No function is called using dot operator , only constructor is get called when object is declared. Here object of copy constructor that is x is copied to Z1 which is 0.
12:33 copy constructor not called. You are a great teacher bhaiya😃👌
Great Tutorial for c++ learner
Harry bhai nested class k baare me btayiye details me please please
thankyou so very much sir. May god bless you❤
What is the purpose of making a copy constructor if the compiler can create its own default constructor?
please share some link where i can easily understand why copy constructor is needed?
Their are two types deep copy & shallow copy
nice explanation bro
9:48--- no error as x ki value 0 hain aur hum wohi value z1 mein dal rhe hain
Please make tutorial on unity gamedevelopment
Hey,did you learned c#?
Yes Harry bhai please make playlist on unity game development
yes harry sir
15:30 Interesting!
You have explained it pretty well! Thank you!
By commenting out copy constructor , It will not give error beacuse default constructor is there .
Correct me If I'm wrong .
correct 👍👍👍
thanks harry bhaiya aapne mera bhit bada confusion solve kiya i dont have words to thank you
Can you please give a tutorial about CGI ?
13:23
because we are initializing it
It'll work. No error will be thrown.
timespan 12:48
what is the output and why if we print z2 object
z2.display();
bhai typing ke liya konsa extension liya h
bhai tum toh great ho , mein apka har video ko like karta hun , thanks bro
Bhai 🙏,game development using c++ ka scope , pls make video,
Pata nai jab youtube pe itna acha content hai tu university pe time barbad ku karie excellent
Love from Pakistan
9:34
error will occurred in my opinion
because there are no constructor for an object
harry bhai if possible can you share the complete list of extensions you use in vs code
thanks in advance
what is the need for passing the object as reference??
Please complete the playlist fast, as our internships our coming and we won't be able to get one with half skills.
ho gaya?
@@abhi.1867 kya hogya
@@ajaykmr8684 placement?
@@ajaykmr8684placement
Mughe ye play list access kiye hoi 15 din hu gayay our itna kuch seeka ke mie university mie poray aik saal mie nai seek paya
Great videos bhaiya really helpful
Hello Harry bhi big fan
Awesome video..☝️🔥🔥❣️
sir why we used default constructor before parametrized constructor
9:48 error aega kyunki koi aisa constructor nahi hai jo as an argument number object ko le sake.
time[13:34]=Yes Copy constructor will be invoked becoz z3 is made and at the same time its assign the value of z
Hum default constructor se factorial calculate karne ka program kyu nhi bana sakte?
No error will be there as it is dynamically created object 9:40 .
13:41 yes will invoke the copy constructor.
Bhai c++ ke saath gaming ke upper video banaoo
Harry bhaiya plz makes notes of c++ with quiz with questions just like u make for c hum padh to rahe hai pr JB tak questions nhi rehege to dimag me bethege kese
bhaiya, practice questions ki bhi playlist h kya c++ ki apki banai hui, i will be awesome if u make that too just like C
does the copy constructor only assign value? Because at 9:30 when the default copy constructor was invoked, it automatically did the value assignment operation.
9:43 I think there should be an error, because no function has parameter as object.
Sir please tora jaldi Web Development wala series complete kar dijiyh
Thanks Harry Bhaiya
Maybe error nhi aayega bcuz reference bhi kuch kuch int ke jaisa hota h ?
Time 12:36
yes , invoke copy Constructors
After making the copy construction an error is occured (obj is not declared in this scope)?
Thank you bro!
Harry bhai pls make app for your website code with harry so we install the app and use in our phone
Has harry bhaiya did any question for palindrome no in c++ ?
Thank you
no error as we have done dynamic initialisation of the constructor.
Sir pehle bhi to bina default constructor bnaye program run hojata tha ab ku nhi hota ??
Sir can you tell me why we use reference in argument when we use object as argument of constructor please??
what was the significance of obj.a in the above code?
it means invoke this function:-
Number(int num){
a = num;
}
otherwise, how will the compiler deduce which constructor needs to be called?
hey harry, here is the code:
#include
using namespace std;
//complex class: handles all the functions related to complex numbers.
class complex{
int real,imag;
public:
complex(int x, int y){
real = x;
imag = y;
}
void display(){
cout
harry bhai, ye 14:27 pe jb ek naye object to purana object creae kiyato error kiyon nhi aya? jaise jn hm kisi object ko koi value assign krte hai to we write
Class obj= Class(a,b) .. so why you are doing Class obj2=obj not Class obj2=Class obj ??
13:28 for Number z3 = z copy constructor will be invoked because there is no such Object with name Z3.
Sr plese make algorithm and data structure please
13:41 yes it will invoke ,!!!
9:41 therer will not be error but will set garbage value of z1.a
Thank you so much sir