Deepcopy: Difference between revisions

Content added Content deleted
m (→‎{{header|C}}: Remove vanity tags)
m (→‎Structures with pointers: Remove vanity tags)
Line 184: Line 184:
Structures with pointers which are usually used to represent data structures such as Linked lists, Stacks, Trees, Graphs etc. have to be copied element by element. A simple assignment as in the above example will not be a copy at all. It will be two pointers pointing towards the same memory location.
Structures with pointers which are usually used to represent data structures such as Linked lists, Stacks, Trees, Graphs etc. have to be copied element by element. A simple assignment as in the above example will not be a copy at all. It will be two pointers pointing towards the same memory location.
<lang C>
<lang C>
/*Abhishek Ghosh, 15th November 2017*/

#include<stdlib.h>
#include<stdlib.h>
#include<stdio.h>
#include<stdio.h>