Message from C, C++ discussions

January 2020

— At 11:25, does that mean deep copy or shallow copy

— 

User Alex has 1/2 warnings; be careful!
The latest warn was because:
pm with asking for help (or assigment or homeworks idk) ....

— BTW In normal terms, when we say copy, what does that mean deep or shallow?

— Old memory of v2 is deleted and pointers of v2 are redirected to that of v1 and pointers of move-from objects revert back to NULL. Right?

Message permanent page

— Continuing from here to 14:30, the 3 operations that can happen with move-from object are 1.destructor call 2. copy 3. move.

Message permanent page

— I understand that when we assign this moved-from object with something else then it behaves/becomes like other normal object.
But I didn't get about the 3rd operation "move". How can we again make a already moved-from object behave like a moved-from object when its pointers are reverted to NULL?

Message permanent page

— Https://ide.geeksforgeeks.org/5lkFsGNsSj
Someone please tell me why am I not getting the output of the second test case!

Input i used is:
2
5 12
1 2 3 7 5
74 665
142 112 54 69 148 45 63 158 38 60 124 142 130 179 117 36 191 43 89 107 41 143 65 49 47 6 91 130 171 151 7 102 194 149 30 24 85 155 157 41 167 177 132 109 145 40 27 124 138 139 119 83 130 142 34 116 40 59 105 131 178 107 74 187 22 146 125 73 71 30 178 174 98 113

Expected output is:
2 4
-1

Message permanent page

— Checkout the link

— Deep

— Shallow copy is memcopy, deep copy respects things like dynamic memory holding, that is, if a filed is a dynamic array, with deep copy new memory will be allocated and data copied from old

Message permanent page

— For vector "pointers are null" is moved-from state

— Hello