Hello Keerti I hope you are doing good and having productive week I have one query suppose I create a integer on Heap(int *p = new int(5)) and pass its address to sharedpointer (sharedpointer spr1(p) and create another sharedpointer(sharedpointer spr2(p)) and now suppose if spr1 goes out of scope before spr2 what will this result in?
Well for everyone’s awareness… shared pointer to mutable object is as good as mutable globals. So as general guideline avoid shared pointers as much as you can.
Hey Keerti, Please bring more C++ Mock Interview videos. And please also cover topics from Basic C++ to Modern C++(At least till C++17)... POV : These videos may not have more views now but Mark My words, Your these types of videos will gain more views in long time. Please keep on giving such contents.. Please add more videos to C++ Playlist where you can talk about all Modern C++ thing and add Mock Interview of C++ there..! These will be very much Useful.. Thank You..!
Those two operators are called "move constructor" and " move assignment operator". There are no such things as "move copy constructor" and "move copy assignment operator".
@@KeertiPurswani please recommend some projects I can work on to improve my c++ skills i.e. shared pointers... I have only worked with c++ stl so far for cp
@@coder7078 make Some game development projects.. you will love using shared pointers,as you have to be very careful with memory allocated for your game objects
Ref count should be atomic. Shared_ptr is only useful in multithreaded environment. You would just use a unique_ptr otherwise.
wrong
No where on the internet you will find such content. Pure gold.
25:11 -> here we should wrap the logic of move constructor by if(this != ptr) because what if the user trying to self move(like moving ptr1 to ptr1)
One thing, you should rename decrementcounter() method as it just does not decrement the counter, it deletes the resources as well.
Good explanantion on video, as the comments in the code explain a lot. But please invest in a mic as the audio is really bad.
Thank you soo much guys this is been really really awesome to learn
Hello Keerti
I hope you are doing good and having productive week
I have one query
suppose I create a integer on Heap(int *p = new int(5)) and pass its address to sharedpointer (sharedpointer spr1(p)
and create another sharedpointer(sharedpointer spr2(p))
and now suppose if spr1 goes out of scope before spr2 what will this result in?
Very well explained :) , To my knowledge there is no need for nullptr check before deleting, delete internally checks it.
i dont think delete checks for nullptr
@@abhinavjha1973 deleting null pointer has no effect, you can correct me if I am wrong :)
Very good explanation of counter Amit ! Keep up the good work.
great video, please do weak pointer implementation video next.
This type of video series are amazing, got to learn a lot
Well for everyone’s awareness… shared pointer to mutable object is as good as mutable globals. So as general guideline avoid shared pointers as much as you can.
Great explanation
Cool! more c++ please and a better mic too.
In copy assignment, is there a memory leak when you are doing res=ptr_res. how will we delete the memory previously pointed by res.
decrement_counter() function handles that
Hey Keerti, Please bring more C++ Mock Interview videos. And please also cover topics from Basic C++ to Modern C++(At least till C++17)...
POV : These videos may not have more views now but Mark My words, Your these types of videos will gain more views in long time. Please keep on giving such contents..
Please add more videos to C++ Playlist where you can talk about all Modern C++ thing and add Mock Interview of C++ there..! These will be very much Useful..
Thank You..!
++
Best Understanding
Those two operators are called "move constructor" and " move assignment operator". There are no such things as "move copy constructor" and "move copy assignment operator".
Ma'am pls can you share information about opportunities for c++ developers in IT field.
Because I rarely see any companies hiring for c++ developers.
All automotive industry use c++, c++ developers are less and more demanding in automotive industry
Hi ma'am same video on Java will be appreciated 💯☝️
where is this even used ??
If you are a C++ developer, it is one of the most important concepts - in daily work as well as in interviews!
@@KeertiPurswani please recommend some projects I can work on to improve my c++ skills i.e. shared pointers...
I have only worked with c++ stl so far for cp
@@coder7078 make Some game development projects.. you will love using shared pointers,as you have to be very careful with memory allocated for your game objects
mam send link of part 1 video
👌 cool
wah sab jante hue bhi kya samjhne ki acting ki hai😀
Ex-boyfriend😂😂😂. grt jok
Is he Bihari ??? You really deserved better
What do you have against Biharis? 😅
I deserved someone who loves me and I got that ❤️✌🏻
@@KeertiPurswani nothing against biharis....
two sentences were independent.