Not. A shallow copy in this particular context means that you are copying "links" (pointers, whatever) to objects, and the backup storage of these links or pointers is identical, it is the same object in the same memory location.
Deep copy, in contrast, means that you are copying the entire object (struct). If he has members that can be copied shallow or deep, you also make a deep copy of them. Consider the following example:
typedef struct { char *name; int value; } Node; Node n1, n2, n3; char name[] = "This is the name"; n1 = (Node){ name, 1337 }; n2 = n1;
user529758
source share