Hi Ebo,
On Sun, Mar 16, 2014 at 9:11 PM, EBo <[email protected]> wrote: ...snip... > Yes, but you need to be careful and make sure that it will do what you > want. For fairly flat structures: > > struct bla { > int some, thing; > float more; > } > > it will do fine, but for: > > struct woof { > struct bla *bla1, *bla2; > char *names[]; > } > > you do not know apreori if you should do a deepcopy or shallow (ie do > you copy the pointers, or do you follow down the pointers and copy all > the subrecords). > > Other than that, it is a very useful feature. Absolutely. Structure copy is only a shallow copy (you could think of it as just a shorthand for memcpy). C++ allows you to override the assignment operator so you can use that to do deep copies. But for C, you're probably better off to code a helper function if you want a deep copy. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
