Name: Anonymous 2010-07-24 2:09
suppose we have the following type:
In order to do a copy, I usually do something like:
But also the following is legal (and far more quick to write).
Is there any disadvantage in doing the second one?
typedef struct {
int bar;
int baz;
int foo;
} Something;In order to do a copy, I usually do something like:
Something a, b;
...
memcpy ((void *) &a, (const void *) &b, sizeof(Something));But also the following is legal (and far more quick to write).
Something a, b;
...
a = b;Is there any disadvantage in doing the second one?